Decompiled source of CalciumCards v1.2.2

CalciumCards.dll

Decompiled 2 days 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;
using CalciumCards.Card;
using CalciumCards.Cards;
using CalciumCards.Effects;
using CalciumCards.MonoBehaviours;
using DrawNCards;
using HarmonyLib;
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 RarityLib.Utils;
using Sonigon;
using SoundImplementation;
using TMPro;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnityEngine;
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 ClusterSpawner : MonoBehaviour
	{
		public class DelayedExplosionActivator : MonoBehaviour
		{
			[CompilerGenerated]
			private sealed class <DelayedExplode>d__5 : IEnumerator<object>, IEnumerator, IDisposable
			{
				private int <>1__state;

				private object <>2__current;

				public DelayedExplosionActivator <>4__this;

				private ParticleSystem[] <>s__1;

				private int <>s__2;

				private ParticleSystem <ps>5__3;

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

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

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

				[DebuggerHidden]
				void IDisposable.Dispose()
				{
					<>s__1 = null;
					<ps>5__3 = null;
					<>1__state = -2;
				}

				private bool MoveNext()
				{
					//IL_002c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0036: Expected O, but got Unknown
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>2__current = (object)new WaitForSeconds(<>4__this.delay);
						<>1__state = 1;
						return true;
					case 1:
						<>1__state = -1;
						<>s__1 = <>4__this.particles;
						for (<>s__2 = 0; <>s__2 < <>s__1.Length; <>s__2++)
						{
							<ps>5__3 = <>s__1[<>s__2];
							<ps>5__3.Play();
							<ps>5__3 = null;
						}
						<>s__1 = null;
						if ((Object)(object)<>4__this.explosionSound != (Object)null && (Object)(object)SoundManager.Instance != (Object)null)
						{
							SoundManager.Instance.Play(<>4__this.explosionSound, ((Component)<>4__this).transform);
						}
						<>4__this.explosion.Explode();
						Object.Destroy((Object)(object)<>4__this);
						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 float delay = 0.75f;

			private Explosion explosion;

			private ParticleSystem[] particles;

			public SoundEvent explosionSound;

			public void Setup(Explosion explosion)
			{
				this.explosion = explosion;
				particles = ((Component)this).GetComponentsInChildren<ParticleSystem>();
				ParticleSystem[] array = particles;
				foreach (ParticleSystem val in array)
				{
					val.Stop(true, (ParticleSystemStopBehavior)0);
				}
				explosion.auto = false;
				((MonoBehaviour)this).StartCoroutine(DelayedExplode());
			}

			[IteratorStateMachine(typeof(<DelayedExplode>d__5))]
			private IEnumerator DelayedExplode()
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <DelayedExplode>d__5(0)
				{
					<>4__this = this
				};
			}
		}

		private Gun explosiveGun;

		public int minExplosionCount = 4;

		public int maxExplosionCount = 8;

		public float explosionRadius = 5f;

		public float explosionDamage = 40f;

		public float explosionRange = 3f;

		public float explosionForce = 5000f;

		public GameObject spawnerGameObject;

		private bool hasExploded = false;

		private void Start()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			GameObject val = (GameObject)Resources.Load("0 cards/Explosive bullet");
			if ((Object)(object)val != (Object)null)
			{
				explosiveGun = val.GetComponent<Gun>();
			}
			else
			{
				Debug.LogError("[ExplosiveBulletSpawner] Could not load Explosive bullet prefab!");
			}
		}

		private void OnDestroy()
		{
			if (!hasExploded)
			{
				hasExploded = true;
				SpawnExplosionEffects();
			}
		}

		private void SpawnExplosionEffects()
		{
			//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_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)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)explosiveGun == (Object)null || explosiveGun.objectsToSpawn == null)
			{
				return;
			}
			Vector3 position = ((Component)this).transform.position;
			Vector3 localScale = ((Component)this).transform.localScale;
			float num = ((Vector3)(ref localScale)).magnitude / Mathf.Sqrt(3f);
			int num2 = Mathf.Min(Random.Range(minExplosionCount, maxExplosionCount + 1), 28);
			for (int i = 0; i < num2; i++)
			{
				float num3 = Random.Range(0f, MathF.PI * 2f);
				float num4 = Random.Range(explosionRadius * 0.5f, explosionRadius);
				Vector3 val = position + new Vector3(Mathf.Cos(num3), Mathf.Sin(num3), 0f) * num4;
				ObjectsToSpawn[] objectsToSpawn = explosiveGun.objectsToSpawn;
				foreach (ObjectsToSpawn val2 in objectsToSpawn)
				{
					if ((Object)(object)val2.effect == (Object)null)
					{
						continue;
					}
					GameObject val3 = Object.Instantiate<GameObject>(val2.effect, val, Quaternion.identity);
					Transform transform = val3.transform;
					transform.localScale *= 0.75f * num;
					Explosion component = val3.GetComponent<Explosion>();
					if (!((Object)(object)component != (Object)null))
					{
						continue;
					}
					component.damage = explosionDamage * num;
					component.range = explosionRange * 0.5f * num;
					component.force = explosionForce * num;
					component.locallySimulated = true;
					component.auto = false;
					SpawnedAttack val4 = val3.GetComponent<SpawnedAttack>();
					if ((Object)(object)val4 == (Object)null)
					{
						val4 = val3.AddComponent<SpawnedAttack>();
					}
					if (!((Object)(object)spawnerGameObject != (Object)null))
					{
						continue;
					}
					Player component2 = spawnerGameObject.GetComponent<Player>();
					if (!((Object)(object)component2 != (Object)null) || !((Object)(object)component2.data != (Object)null))
					{
						continue;
					}
					val4.spawner = component2;
					SoundEvent soundCharacterLand = component2.data.playerSounds.soundCharacterLand;
					if ((Object)(object)soundCharacterLand != (Object)null)
					{
						DelayedExplosionActivator delayedExplosionActivator = val3.GetComponent<DelayedExplosionActivator>();
						if ((Object)(object)delayedExplosionActivator == (Object)null)
						{
							delayedExplosionActivator = val3.AddComponent<DelayedExplosionActivator>();
						}
						delayedExplosionActivator.Setup(component);
						delayedExplosionActivator.delay = 0.3f + 0.1f * (float)i;
						delayedExplosionActivator.explosionSound = soundCharacterLand;
					}
					else
					{
						Debug.LogWarning("[ExplosiveBulletSpawner] Player's land sound was null, skipping sound assignment.");
					}
				}
			}
		}
	}
	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<RepeatShotHelper.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
	{
		public class RepeatShotCardHook : MonoBehaviour
		{
			public int repeatCount = 0;

			public float repeatDelay = 0f;

			private Gun gun;

			private void Awake()
			{
				gun = ((Component)this).GetComponent<Gun>();
				if ((Object)(object)gun == (Object)null)
				{
					Debug.LogError("[RepeatShotCardHook] No Gun component found on this GameObject.");
					((Behaviour)this).enabled = false;
				}
			}

			private void OnEnable()
			{
				if ((Object)(object)gun != (Object)null)
				{
					Gun obj = gun;
					obj.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(obj.ShootPojectileAction, new Action<GameObject>(OnShootProjectile));
				}
			}

			private void OnDisable()
			{
				if ((Object)(object)gun != (Object)null)
				{
					Gun obj = gun;
					obj.ShootPojectileAction = (Action<GameObject>)Delegate.Remove(obj.ShootPojectileAction, new Action<GameObject>(OnShootProjectile));
				}
			}

			private void OnShootProjectile(GameObject bullet)
			{
				if (!((Object)(object)bullet == (Object)null) && !((Object)(object)bullet.GetComponent<RepeatShotSpawner>() != (Object)null))
				{
					RepeatShotSpawner repeatShotSpawner = bullet.AddComponent<RepeatShotSpawner>();
					repeatShotSpawner.Initialize(gun, repeatCount, repeatDelay);
				}
			}
		}

		public class TimedSelfDestruct : MonoBehaviour
		{
			public float lifetime = 25f;

			private void Start()
			{
				Object.Destroy((Object)(object)((Component)this).gameObject, lifetime);
			}
		}

		public class RepeatedBulletMarker : MonoBehaviour
		{
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass1_0
		{
			public int playerID;

			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 Player <localPlayer>5__2;

			private int <i>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;

			private int <j>5__9;

			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__2 = null;
				<clone>5__5 = null;
				<hit>5__6 = null;
				<trail>5__7 = null;
				<pv>5__8 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00fe: 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_027a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0284: Expected O, but got Unknown
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00db: 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;
					<localPlayer>5__2 = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == <>8__1.playerID));
					if ((Object)(object)<localPlayer>5__2 == (Object)null || !<localPlayer>5__2.data.view.IsMine)
					{
						Object.Destroy((Object)(object)((Component)<>4__this).gameObject);
						return false;
					}
					<i>5__3 = 0;
					break;
				case 1:
					<>1__state = -1;
					<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.op_Implicit((Object)(object)<hit>5__6))
					{
						((Behaviour)<hit>5__6).enabled = false;
					}
					if (Object.op_Implicit((Object)(object)<trail>5__7))
					{
						((Behaviour)<trail>5__7).enabled = false;
					}
					<pv>5__8 = null;
					<j>5__9 = 0;
					goto IL_01eb;
				case 2:
					<>1__state = -1;
					<j>5__9++;
					goto IL_01eb;
				case 3:
					{
						<>1__state = -1;
						if (Object.op_Implicit((Object)(object)<hit>5__6))
						{
							((Behaviour)<hit>5__6).enabled = true;
							if ((Object)(object)<hit>5__6.ownPlayer == (Object)null)
							{
								<hit>5__6.ownPlayer = <localPlayer>5__2;
							}
						}
						if (Object.op_Implicit((Object)(object)<trail>5__7))
						{
							((Behaviour)<trail>5__7).enabled = true;
						}
						<clone>5__5 = null;
						<hit>5__6 = null;
						<trail>5__7 = null;
						<pv>5__8 = null;
						goto IL_0319;
					}
					IL_0319:
					<i>5__3++;
					break;
					IL_01eb:
					if (<j>5__9 < 10)
					{
						<pv>5__8 = <clone>5__5.GetComponent<PhotonView>();
						if (!((Object)(object)<pv>5__8 != (Object)null) || !<pv>5__8.IsMine)
						{
							<>2__current = null;
							<>1__state = 2;
							return true;
						}
					}
					if ((Object)(object)<pv>5__8 == (Object)null)
					{
						Debug.LogWarning("[RepeatShot] PhotonView not found after spawn.");
						PhotonNetwork.Destroy(<clone>5__5);
						goto IL_0319;
					}
					<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;
				}
				if (<i>5__3 < repeatCount)
				{
					<>2__current = (object)new WaitForSeconds(delay);
					<>1__state = 1;
					return true;
				}
				Object.Destroy((Object)(object)((Component)<>4__this).gameObject, 0.5f);
				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 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);
			}
		}
	}
	public class UndoMono : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass10_0
		{
			public Player player;

			public Rarity removedCardRarity;

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

			internal bool <GiveExtraPick>b__1(CardInfo card)
			{
				//IL_0001: 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)
				return card.rarity >= removedCardRarity && card.cardName != "Ctrl Z";
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass10_1
		{
			public string cardToRemoveName;

			internal bool <GiveExtraPick>b__2(CardInfo c)
			{
				return c.cardName == cardToRemoveName;
			}
		}

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

			private object <>2__current;

			public Player player;

			public UndoMono <>4__this;

			private <>c__DisplayClass10_0 <>8__1;

			private Queue<string> <history>5__2;

			private int <playerIndex>5__3;

			private CardInfo[] <originalCards>5__4;

			private CardInfo[] <filteredCards>5__5;

			private CardInfo <newCard>5__6;

			private <>c__DisplayClass10_1 <>8__7;

			private CardInfo <cardToRemove>5__8;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>8__1 = null;
				<history>5__2 = null;
				<originalCards>5__4 = null;
				<filteredCards>5__5 = null;
				<newCard>5__6 = null;
				<>8__7 = null;
				<cardToRemove>5__8 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Expected O, but got Unknown
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_033d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0347: Expected O, but got Unknown
				//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01de: Expected O, but got Unknown
				//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0307: Expected O, but got Unknown
				//IL_0170: Unknown result type (might be due to invalid IL or missing references)
				//IL_0175: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>8__1 = new <>c__DisplayClass10_0();
					<>8__1.player = player;
					<>2__current = (object)new WaitForSecondsRealtime(0.2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = GameModeManager.TriggerHook("PlayerPickStart");
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<>8__1.removedCardRarity = (Rarity)0;
					if (<>4__this.pickHistory.TryGetValue(<>8__1.player.playerID, out <history>5__2) && <history>5__2.Count > 0)
					{
						<>8__7 = new <>c__DisplayClass10_1();
						<>8__7.cardToRemoveName = <history>5__2.Dequeue();
						<cardToRemove>5__8 = ((IEnumerable<CardInfo>)<>8__1.player.data.currentCards).LastOrDefault((Func<CardInfo, bool>)((CardInfo c) => c.cardName == <>8__7.cardToRemoveName));
						if ((Object)(object)<cardToRemove>5__8 != (Object)null)
						{
							<>8__1.removedCardRarity = <cardToRemove>5__8.rarity;
							Cards.instance.RemoveCardFromPlayer(<>8__1.player, <cardToRemove>5__8, (SelectionType)2, true);
						}
						<>8__7 = null;
						<cardToRemove>5__8 = null;
					}
					<playerIndex>5__3 = PlayerManager.instance.players.FindIndex((Player p) => p.playerID == <>8__1.player.playerID);
					<>2__current = (object)new WaitForSecondsRealtime(0.2f);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					CardChoiceVisuals.instance.Show(<playerIndex>5__3, true);
					<originalCards>5__4 = CardChoice.instance.cards;
					<filteredCards>5__5 = <originalCards>5__4.Where((CardInfo card) => card.rarity >= <>8__1.removedCardRarity && card.cardName != "Ctrl Z").ToArray();
					CardChoice.instance.cards = <filteredCards>5__5;
					<>2__current = CardChoice.instance.DoPick(1, <>8__1.player.playerID, (PickerType)1);
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -1;
					CardChoice.instance.cards = <originalCards>5__4;
					<newCard>5__6 = <>8__1.player.data.currentCards.LastOrDefault();
					if ((Object)(object)<newCard>5__6 != (Object)null && <newCard>5__6.cardName != "Ctrl Z")
					{
						<>4__this.RegisterPick(<>8__1.player, <newCard>5__6.cardName);
					}
					<>2__current = (object)new WaitForSecondsRealtime(0.1f);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -1;
					<>2__current = GameModeManager.TriggerHook("PlayerPickEnd");
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -1;
					<>2__current = (object)new WaitForSecondsRealtime(0.1f);
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -1;
					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();
			}
		}

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

			private object <>2__current;

			public UndoMono <>4__this;

			private List<Player>.Enumerator <>s__1;

			private Player <player>5__2;

			private List<string> <before>5__3;

			private List<string> <after>5__4;

			private List<string> <newlyPicked>5__5;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>s__1 = default(List<Player>.Enumerator);
				<player>5__2 = null;
				<before>5__3 = null;
				<after>5__4 = null;
				<newlyPicked>5__5 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				if (global::CalciumCards.CalciumCards.isProcessingExtraPick)
				{
					return false;
				}
				<>s__1 = PlayerManager.instance.players.GetEnumerator();
				try
				{
					while (<>s__1.MoveNext())
					{
						<player>5__2 = <>s__1.Current;
						if (<>4__this.cardAtPickStart.TryGetValue(<player>5__2.playerID, out <before>5__3))
						{
							<after>5__4 = <player>5__2.data.currentCards.Select((CardInfo c) => c.cardName).ToList();
							<newlyPicked>5__5 = <after>5__4.Except(<before>5__3).ToList();
							if (<newlyPicked>5__5.Count == 1 && <newlyPicked>5__5[0] != "Ctrl Z")
							{
								<>4__this.RegisterPick(<player>5__2, <newlyPicked>5__5[0]);
							}
							<before>5__3 = null;
							<after>5__4 = null;
							<newlyPicked>5__5 = null;
							<player>5__2 = null;
						}
					}
				}
				finally
				{
					((IDisposable)<>s__1).Dispose();
				}
				<>s__1 = default(List<Player>.Enumerator);
				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();
			}
		}

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

			private object <>2__current;

			public UndoMono <>4__this;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				<>4__this.SetCardAtPickStart();
				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();
			}
		}

		private Dictionary<int, Queue<string>> pickHistory = new Dictionary<int, Queue<string>>();

		private Dictionary<int, List<string>> cardAtPickStart = new Dictionary<int, List<string>>();

		public static UndoMono instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)instance != (Object)null && (Object)(object)instance != (Object)(object)this)
			{
				Object.Destroy((Object)(object)this);
				return;
			}
			instance = this;
			Object.DontDestroyOnLoad((Object)(object)this);
		}

		public void ResetState()
		{
			pickHistory.Clear();
			cardAtPickStart.Clear();
		}

		public void SetCardAtPickStart()
		{
			cardAtPickStart.Clear();
			foreach (Player player in PlayerManager.instance.players)
			{
				cardAtPickStart[player.playerID] = player.data.currentCards.Select((CardInfo c) => c.cardName).ToList();
			}
		}

		public void RegisterPick(Player player, string pickedCardName)
		{
			if (!pickHistory.ContainsKey(player.playerID))
			{
				pickHistory[player.playerID] = new Queue<string>();
			}
			Queue<string> queue = pickHistory[player.playerID];
			queue.Enqueue(pickedCardName);
			while (queue.Count > 1)
			{
				queue.Dequeue();
			}
		}

		[IteratorStateMachine(typeof(<GiveExtraPick>d__10))]
		public IEnumerator GiveExtraPick(Player player)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <GiveExtraPick>d__10(0)
			{
				<>4__this = this,
				player = player
			};
		}

		[IteratorStateMachine(typeof(<OnPickStartHook>d__11))]
		public IEnumerator OnPickStartHook()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnPickStartHook>d__11(0)
			{
				<>4__this = this
			};
		}

		[IteratorStateMachine(typeof(<OnPickEndHook>d__12))]
		public IEnumerator OnPickEndHook()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnPickEndHook>d__12(0)
			{
				<>4__this = this
			};
		}
	}
}
namespace Calcium.Effects
{
	public class AmmoSpongeEffect : WasHitEffect
	{
		private Player player;

		private int extraAmmo = 0;

		private int lastTotalRounds = -1;

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

		private void Update()
		{
			if (GameModeManager.CurrentHandler != null)
			{
				int num = (from tid in PlayerManager.instance.players.Select((Player p) => p.teamID).Distinct()
					select GameModeManager.CurrentHandler.GetTeamScore(tid).rounds).Sum();
				if (num != lastTotalRounds)
				{
					ResetAmmo();
					lastTotalRounds = num;
				}
			}
		}

		private void UpdateTotalRounds()
		{
			if (GameModeManager.CurrentHandler != null)
			{
				lastTotalRounds = (from tid in PlayerManager.instance.players.Select((Player p) => p.teamID).Distinct()
					select GameModeManager.CurrentHandler.GetTeamScore(tid).rounds).Sum();
			}
		}

		public override void WasDealtDamage(Vector2 damage, bool selfDamage)
		{
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			if (selfDamage || (Object)(object)player == (Object)null)
			{
				return;
			}
			Gun gun = player.data.weaponHandler.gun;
			GunAmmo componentInChildren = ((Component)gun).GetComponentInChildren<GunAmmo>();
			if ((Object)(object)componentInChildren == (Object)null)
			{
				return;
			}
			FieldInfo field = typeof(GunAmmo).GetField("currentAmmo", BindingFlags.Instance | BindingFlags.NonPublic);
			FieldInfo field2 = typeof(GunAmmo).GetField("lastMaxAmmo", BindingFlags.Instance | BindingFlags.NonPublic);
			if (!(field == null) && !(field2 == null))
			{
				componentInChildren.maxAmmo++;
				extraAmmo++;
				int num = (int)field.GetValue(componentInChildren);
				num = Mathf.Min(num + 1, componentInChildren.maxAmmo);
				field.SetValue(componentInChildren, num);
				field2.SetValue(componentInChildren, componentInChildren.maxAmmo);
				Populate populate = componentInChildren.populate;
				if ((Object)(object)populate != (Object)null)
				{
					populate.times = componentInChildren.maxAmmo;
					populate.DoPopulate();
				}
				MethodInfo method = typeof(GunAmmo).GetMethod("SetActiveBullets", BindingFlags.Instance | BindingFlags.NonPublic);
				method.Invoke(componentInChildren, new object[1] { false });
				PlayerSkinHandler componentInChildren2 = ((Component)player.data.healthHandler).GetComponentInChildren<PlayerSkinHandler>();
				if (componentInChildren2 != null)
				{
					componentInChildren2.BlinkColor(Color.red);
				}
			}
		}

		private void ResetAmmo()
		{
			if (extraAmmo == 0)
			{
				return;
			}
			Gun gun = player.data.weaponHandler.gun;
			GunAmmo componentInChildren = ((Component)gun).GetComponentInChildren<GunAmmo>();
			if (!((Object)(object)componentInChildren == (Object)null))
			{
				componentInChildren.maxAmmo -= extraAmmo;
				FieldInfo field = typeof(GunAmmo).GetField("currentAmmo", BindingFlags.Instance | BindingFlags.NonPublic);
				FieldInfo field2 = typeof(GunAmmo).GetField("lastMaxAmmo", BindingFlags.Instance | BindingFlags.NonPublic);
				if (field != null && field2 != null)
				{
					int num = (int)field.GetValue(componentInChildren);
					num = Mathf.Min(num, componentInChildren.maxAmmo);
					field.SetValue(componentInChildren, num);
					field2.SetValue(componentInChildren, componentInChildren.maxAmmo);
				}
				typeof(GunAmmo).GetMethod("SetActiveBullets", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(componentInChildren, new object[1] { false });
				extraAmmo = 0;
			}
		}
	}
	public class MasochismEffect : WasDealtDamageEffect
	{
		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.4f;
			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, 6f, (Action)delegate
			{
				if (!((Object)(object)gun == (Object)null) && !((Object)(object)gunAmmo == (Object)null))
				{
					Gun obj4 = gun;
					obj4.damage /= 1.4f;
					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;
			}
		}
	}
	public static class UndoEffect
	{
		public static Player targetPlayer;

		public static string SpecialCardName;

		public static bool hasTriggeredThisPhase;

		public static void TriggerExtraPicks(Player player, string UndoCard)
		{
			if (!hasTriggeredThisPhase)
			{
				targetPlayer = player;
				SpecialCardName = UndoCard;
				hasTriggeredThisPhase = true;
			}
		}

		public static void ResetPhase()
		{
			hasTriggeredThisPhase = false;
			SpecialCardName = null;
			targetPlayer = null;
		}
	}
}
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
	{
		[CompilerGenerated]
		private sealed class <OnPlayerPickEnded>d__32 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public IGameModeHandler gm;

			public CalciumCards <>4__this;

			private Player <player>5__1;

			private IEnumerator <extraPick>5__2;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || num == 1)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<player>5__1 = null;
				<extraPick>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				try
				{
					int num = <>1__state;
					if (num != 0)
					{
						if (num != 1)
						{
							return false;
						}
						<>1__state = -3;
					}
					else
					{
						<>1__state = -1;
						if (isProcessingExtraPick)
						{
							return false;
						}
						if (!((Object)(object)UndoEffect.targetPlayer != (Object)null))
						{
							goto IL_00d1;
						}
						isProcessingExtraPick = true;
						<player>5__1 = UndoEffect.targetPlayer;
						UndoEffect.targetPlayer = null;
						<extraPick>5__2 = UndoMono.instance.GiveExtraPick(<player>5__1);
						<>1__state = -3;
					}
					if (<extraPick>5__2.MoveNext())
					{
						<>2__current = <extraPick>5__2.Current;
						<>1__state = 1;
						return true;
					}
					<>m__Finally1();
					<player>5__1 = null;
					<extraPick>5__2 = null;
					goto IL_00d1;
					IL_00d1:
					return false;
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

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

			private void <>m__Finally1()
			{
				<>1__state = -1;
				isProcessingExtraPick = false;
				UndoEffect.ResetPhase();
			}

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

		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 BloodBurst = Bundle.LoadAsset<GameObject>("A_BloodBurst");

		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 GameObject Undo = Bundle.LoadAsset<GameObject>("C_Undo");

		public static GameObject AmmoSponge = Bundle.LoadAsset<GameObject>("C_BulletSponge");

		public static GameObject ClusterBomb = Bundle.LoadAsset<GameObject>("C_Cluster");

		public static GameObject Tiny = Bundle.LoadAsset<GameObject>("C_Tiny");

		public static GameObject Coin = Bundle.LoadAsset<GameObject>("C_CursedCoin");

		public static GameObject Stim = Bundle.LoadAsset<GameObject>("C_Stim");

		public static GameObject Bond = Bundle.LoadAsset<GameObject>("C_ParasiticBond");

		public static GameObject BloodBullet = Bundle.LoadAsset<GameObject>("C_BloodBullet");

		public static GameObject Placeholder = Bundle.LoadAsset<GameObject>("C_PlaceHolder");

		public static bool isProcessingExtraPick = false;

		public static CalciumCards instance { get; private set; }

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("com.Tree.rounds.CalciumCards");
			val.PatchAll();
		}

		private void Start()
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			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>();
			CustomCard.BuildCard<Undo>();
			CustomCard.BuildCard<AmmoSponge>();
			CustomCard.BuildCard<ClusterBomb>();
			CustomCard.BuildCard<Tiny>();
			CustomCard.BuildCard<OccultTheft>();
			CustomCard.BuildCard<CursedCoinFlip>();
			CustomCard.BuildCard<Stim>();
			CustomCard.BuildCard<ParasiticBond>();
			CustomCard.BuildCard<BloodBullet>();
			if ((Object)(object)UndoMono.instance == (Object)null)
			{
				GameObject val = new GameObject("UndoHelper");
				val.AddComponent<UndoMono>();
			}
			GameModeManager.AddHook("PlayerPickStart", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler _) => UndoMono.instance.OnPickStartHook()));
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler _) => UndoMono.instance.OnPickEndHook()));
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickEnded);
			GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)delegate
			{
				AbortExtraPickIfRunning();
				UndoMono.instance?.ResetState();
				return null;
			});
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)delegate
			{
				AbortExtraPickIfRunning();
				UndoMono.instance?.ResetState();
				return null;
			});
		}

		[IteratorStateMachine(typeof(<OnPlayerPickEnded>d__32))]
		private IEnumerator OnPlayerPickEnded(IGameModeHandler gm)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnPlayerPickEnded>d__32(0)
			{
				<>4__this = this,
				gm = gm
			};
		}

		private void AbortExtraPickIfRunning()
		{
			if (isProcessingExtraPick)
			{
				isProcessingExtraPick = false;
				UndoEffect.ResetPhase();
			}
		}
	}
}
namespace CalciumCards.Patches
{
	[HarmonyPatch(typeof(HealthHandler))]
	public class ParasiteHealPatch
	{
		private static bool isStealing;

		[HarmonyPatch("Heal")]
		[HarmonyPrefix]
		public static void Heal(CharacterData ___data, ref float healAmount)
		{
			if (isStealing)
			{
				return;
			}
			Player player = ___data.player;
			if ((Object)(object)player == (Object)null)
			{
				return;
			}
			float num = 0.1f;
			float num2 = 0f;
			foreach (Player player2 in PlayerManager.instance.players)
			{
				if (!((Object)(object)player2 == (Object)(object)player) && !((Object)(object)player2 == (Object)null) && !((Object)(object)player2.data == (Object)null))
				{
					ParasiticBondMono[] componentsInChildren = ((Component)player2.data).GetComponentsInChildren<ParasiticBondMono>();
					foreach (ParasiticBondMono parasiticBondMono in componentsInChildren)
					{
						float num3 = healAmount * num;
						isStealing = true;
						parasiticBondMono.StealHeal(num3);
						isStealing = false;
						num2 += num3;
					}
				}
			}
			healAmount = Mathf.Max(0f, healAmount - num2);
		}
	}
}
namespace CalciumCards.MonoBehaviours
{
	public class BloodBulletMono : MonoBehaviour
	{
		private ProjectileHit projHit;

		public void Init(ProjectileHit hit)
		{
			projHit = hit;
			if ((Object)(object)projHit != (Object)null)
			{
				projHit.AddHitActionWithData((Action<HitInfo>)OnHit);
			}
		}

		private void OnHit(HitInfo hitInfo)
		{
			//IL_001a: 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_003d: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			GameObject bloodBurst = CalciumCards.BloodBurst;
			if ((Object)(object)bloodBurst != (Object)null)
			{
				GameObject val = Object.Instantiate<GameObject>(bloodBurst, Vector2.op_Implicit(hitInfo.point), Quaternion.Euler(0f, 0f, Random.Range(0f, 360f)));
				Transform transform = val.transform;
				transform.localScale *= ((Component)projHit).transform.localScale.x;
				ParticleSystem component = val.GetComponent<ParticleSystem>();
				if ((Object)(object)component != (Object)null)
				{
					MainModule main = component.main;
					MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
					Object.Destroy((Object)(object)val, ((MinMaxCurve)(ref startLifetime)).constantMax + 0.5f);
				}
				else
				{
					Object.Destroy((Object)(object)val, 2f);
				}
			}
			Damagable val2 = null;
			if ((Object)(object)hitInfo.rigidbody != (Object)null)
			{
				val2 = ((Component)hitInfo.rigidbody).GetComponentInParent<Damagable>();
			}
			else if ((Object)(object)hitInfo.transform != (Object)null)
			{
				val2 = ((Component)hitInfo.transform).GetComponentInParent<Damagable>();
			}
			float num = 2f;
			float num2 = ((projHit.damage > 0f) ? projHit.damage : 1f);
			float num3 = 5f + 0.05f * num2;
			HashSet<Player> hashSet = new HashSet<Player>();
			HashSet<Damagable> hashSet2 = new HashSet<Damagable>();
			Collider2D[] array = Physics2D.OverlapCircleAll(hitInfo.point, num);
			Collider2D[] array2 = array;
			foreach (Collider2D val3 in array2)
			{
				Damagable componentInParent = ((Component)val3).GetComponentInParent<Damagable>();
				if ((Object)(object)componentInParent == (Object)null || (Object)(object)componentInParent == (Object)(object)val2)
				{
					continue;
				}
				Player componentInParent2 = ((Component)val3).GetComponentInParent<Player>();
				Bounds bounds;
				Vector2 val4;
				if ((Object)(object)componentInParent2 != (Object)null && (Object)(object)projHit.ownPlayer != (Object)null)
				{
					if ((Object)(object)componentInParent2 == (Object)(object)projHit.ownPlayer || componentInParent2.teamID == projHit.ownPlayer.teamID || !hashSet.Add(componentInParent2))
					{
						continue;
					}
					Damagable component2 = ((Component)componentInParent2).GetComponent<Damagable>();
					if (!((Object)(object)component2 == (Object)null))
					{
						bounds = val3.bounds;
						val4 = Vector2.op_Implicit(((Bounds)(ref bounds)).ClosestPoint(Vector2.op_Implicit(hitInfo.point))) - hitInfo.point;
						Vector2 val5 = ((Vector2)(ref val4)).normalized;
						if (val5 == Vector2.zero)
						{
							val5 = Vector2.up;
						}
						component2.TakeDamage(num3 * val5, hitInfo.point, (GameObject)null, projHit.ownPlayer, true, true);
					}
				}
				else if (hashSet2.Add(componentInParent))
				{
					bounds = val3.bounds;
					val4 = Vector2.op_Implicit(((Bounds)(ref bounds)).ClosestPoint(Vector2.op_Implicit(hitInfo.point))) - hitInfo.point;
					Vector2 val6 = ((Vector2)(ref val4)).normalized;
					if (val6 == Vector2.zero)
					{
						val6 = Vector2.up;
					}
					componentInParent.TakeDamage(num3 * val6, hitInfo.point, (GameObject)null, projHit.ownPlayer, true, true);
				}
			}
		}
	}
	public class CalamityMono : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <RedistributeCursesAndAddCards>d__2 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Player originPlayer;

			public List<CardInfo> curses;

			public List<Player> enemies;

			public List<CardInfo> cardsToAddToOrigin;

			public float delay;

			public CalamityMono <>4__this;

			private List<CardInfo>.Enumerator <>s__1;

			private CardInfo <curse>5__2;

			private Player <randomEnemy>5__3;

			private List<CardInfo>.Enumerator <>s__4;

			private CardInfo <card>5__5;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				switch (<>1__state)
				{
				case -3:
				case 1:
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
					break;
				case -4:
				case 2:
					try
					{
					}
					finally
					{
						<>m__Finally2();
					}
					break;
				}
				<>s__1 = default(List<CardInfo>.Enumerator);
				<curse>5__2 = null;
				<randomEnemy>5__3 = null;
				<>s__4 = default(List<CardInfo>.Enumerator);
				<card>5__5 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: Expected O, but got Unknown
				//IL_0167: Unknown result type (might be due to invalid IL or missing references)
				//IL_0171: Expected O, but got Unknown
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>s__1 = curses.GetEnumerator();
						<>1__state = -3;
						goto IL_00e7;
					case 1:
						<>1__state = -3;
						<randomEnemy>5__3 = null;
						<curse>5__2 = null;
						goto IL_00e7;
					case 2:
						{
							<>1__state = -4;
							<card>5__5 = null;
							break;
						}
						IL_00e7:
						if (<>s__1.MoveNext())
						{
							<curse>5__2 = <>s__1.Current;
							<randomEnemy>5__3 = enemies[Random.Range(0, enemies.Count)];
							Cards.instance.AddCardToPlayer(<randomEnemy>5__3, <curse>5__2, false, "", 2f, 2f, true);
							<>2__current = (object)new WaitForSeconds(delay);
							<>1__state = 1;
							return true;
						}
						<>m__Finally1();
						<>s__1 = default(List<CardInfo>.Enumerator);
						<>s__4 = cardsToAddToOrigin.GetEnumerator();
						<>1__state = -4;
						break;
					}
					if (<>s__4.MoveNext())
					{
						<card>5__5 = <>s__4.Current;
						Cards.instance.AddCardToPlayer(originPlayer, <card>5__5, false, "", 2f, 2f, true);
						<>2__current = (object)new WaitForSeconds(delay);
						<>1__state = 2;
						return true;
					}
					<>m__Finally2();
					<>s__4 = default(List<CardInfo>.Enumerator);
					return false;
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

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

			private void <>m__Finally1()
			{
				<>1__state = -1;
				((IDisposable)<>s__1).Dispose();
			}

			private void <>m__Finally2()
			{
				<>1__state = -1;
				((IDisposable)<>s__4).Dispose();
			}

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

		public static CalamityMono Instance;

		private void Awake()
		{
			if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			Instance = this;
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}

		[IteratorStateMachine(typeof(<RedistributeCursesAndAddCards>d__2))]
		public IEnumerator RedistributeCursesAndAddCards(Player originPlayer, List<CardInfo> curses, List<Player> enemies, List<CardInfo> cardsToAddToOrigin, float delay)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <RedistributeCursesAndAddCards>d__2(0)
			{
				<>4__this = this,
				originPlayer = originPlayer,
				curses = curses,
				enemies = enemies,
				cardsToAddToOrigin = cardsToAddToOrigin,
				delay = delay
			};
		}
	}
	public class ParasiticBondMono : MonoBehaviour
	{
		private Player player;

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

		public void StealHeal(float amount)
		{
			if (!(amount <= 0f))
			{
				player.data.healthHandler.Heal(amount);
			}
		}
	}
}
namespace CalciumCards.Effects
{
	public class StimEffect : ReversibleEffect
	{
		[CompilerGenerated]
		private sealed class <RegisterPointHookNextFrame>d__8 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public StimEffect <>4__this;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>4__this._pointStartHook = delegate
					{
						if ((Object)(object)((ReversibleEffect)<>4__this).gun != (Object)null)
						{
							Gun gun = ((ReversibleEffect)<>4__this).gun;
							gun.attackSpeed -= <>4__this.AttackSpeedIncrease;
						}
						if ((Object)(object)<>4__this.characterStats != (Object)null)
						{
							CharacterStatModifiers characterStats = <>4__this.characterStats;
							characterStats.movementSpeed -= <>4__this.MoveSpeedIncrease;
						}
						<>4__this.AttackSpeedIncrease = 0f;
						<>4__this.MoveSpeedIncrease = 0f;
						if ((Object)(object)<>4__this.trail != (Object)null)
						{
							<>4__this.trail.time = 0f;
							<>4__this.trail.Clear();
						}
						return null;
					};
					GameModeManager.AddHook("PointStart", <>4__this._pointStartHook);
					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();
			}
		}

		private float AttackSpeedIncrease;

		private float maxAttackSpeedMultiplier = 0.5f;

		private float MoveSpeedIncrease;

		private float maxMoveSpeedMultiplier = 1.8f;

		private Func<IGameModeHandler, IEnumerator> _pointStartHook;

		private CharacterStatModifiers characterStats;

		private TrailRenderer trail;

		public override void OnStart()
		{
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: 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_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Expected O, but got Unknown
			base.gun = base.player.data.weaponHandler?.gun;
			characterStats = ((Component)base.player).GetComponent<CharacterStatModifiers>();
			trail = ((Component)base.player).GetComponentInChildren<TrailRenderer>();
			if ((Object)(object)trail == (Object)null)
			{
				trail = ((Component)base.player).gameObject.AddComponent<TrailRenderer>();
				trail.time = 0.5f;
				trail.startWidth = 0.2f;
				trail.endWidth = 0f;
				Gradient val = new Gradient();
				val.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
				{
					new GradientColorKey(new Color(0f, 1f, 0f, 0.5f), 0f),
					new GradientColorKey(new Color(0f, 1f, 0f, 0f), 1f)
				}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
				{
					new GradientAlphaKey(0.5f, 0f),
					new GradientAlphaKey(0f, 1f)
				});
				trail.colorGradient = val;
				((Renderer)trail).material = new Material(Shader.Find("Sprites/Default"));
			}
			((ReversibleEffect)this).SetLivesToEffect(9999);
			((MonoBehaviour)this).StartCoroutine(RegisterPointHookNextFrame());
		}

		[IteratorStateMachine(typeof(<RegisterPointHookNextFrame>d__8))]
		private IEnumerator RegisterPointHookNextFrame()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <RegisterPointHookNextFrame>d__8(0)
			{
				<>4__this = this
			};
		}

		private void Update()
		{
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Expected O, but got Unknown
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: 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_023c: 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)
			if (PlayerStatus.PlayerAliveAndSimulated(base.player))
			{
				float num = Mathf.Clamp01(base.player.data.health / base.player.data.maxHealth);
				if ((Object)(object)base.gun != (Object)null)
				{
					Gun gun = base.gun;
					gun.attackSpeed -= AttackSpeedIncrease;
				}
				if ((Object)(object)characterStats != (Object)null)
				{
					CharacterStatModifiers obj = characterStats;
					obj.movementSpeed -= MoveSpeedIncrease;
				}
				AttackSpeedIncrease = (((Object)(object)base.gun != (Object)null) ? (base.gun.attackSpeed * (Mathf.Lerp(1f, maxAttackSpeedMultiplier, 1f - num) - 1f)) : 0f);
				MoveSpeedIncrease = (((Object)(object)characterStats != (Object)null) ? (characterStats.movementSpeed * (Mathf.Lerp(1f, maxMoveSpeedMultiplier, 1f - num) - 1f)) : 0f);
				if ((Object)(object)base.gun != (Object)null)
				{
					Gun gun2 = base.gun;
					gun2.attackSpeed += AttackSpeedIncrease;
				}
				if ((Object)(object)characterStats != (Object)null)
				{
					CharacterStatModifiers obj2 = characterStats;
					obj2.movementSpeed += MoveSpeedIncrease;
				}
				if ((Object)(object)trail != (Object)null)
				{
					float num2 = 1f - num;
					trail.time = Mathf.Lerp(0.1f, 0.5f, num2);
					float num3 = 0f + 0.5f * num2;
					Gradient val = new Gradient();
					val.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
					{
						new GradientColorKey(new Color(0f, 1f, 0f, num3), 0f),
						new GradientColorKey(new Color(0f, 1f, 0f, 0f), 1f)
					}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
					{
						new GradientAlphaKey(num3, 0f),
						new GradientAlphaKey(0f, 1f)
					});
					trail.colorGradient = val;
				}
			}
		}

		public override void OnOnDestroy()
		{
			if (_pointStartHook != null)
			{
				GameModeManager.RemoveHook("PointStart", _pointStartHook);
				_pointStartHook = null;
			}
			if ((Object)(object)trail != (Object)null)
			{
				Object.Destroy((Object)(object)trail);
			}
		}
	}
}
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()
		{
			string text = "#8B0000";
			return "Give a <color=" + text + ">Curse</color> 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 AmmoSponge : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			cardInfo.allowMultiple = false;
			gun.reloadTimeAdd = 0.25f;
			gun.attackSpeed = 1.25f;
			statModifiers.health = 1.2f;
		}

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

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

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

		protected override string GetDescription()
		{
			return "Absorb bullets that hit you, resets on round end.";
		}

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

		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 = "Health",
					amount = "",
					simepleAmount = (SimpleAmount)1
				},
				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)0;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	internal class BloodBullet : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			//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)
			gun.projectileColor = Color.red;
			gun.reloadTimeAdd = 0.25f;
			statModifiers.health = 0.8f;
			statModifiers.lifeSteal = 0.3f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			gun.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(gun.ShootPojectileAction, (Action<GameObject>)delegate(GameObject projectile)
			{
				if (!Object.op_Implicit((Object)(object)projectile.gameObject.GetComponent<BloodBulletMono>()))
				{
					BloodBulletMono bloodBulletMono = projectile.gameObject.AddComponent<BloodBulletMono>();
					bloodBulletMono.Init(projectile.GetComponent<ProjectileHit>());
				}
			});
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			gun.ShootPojectileAction = delegate(GameObject projectile)
			{
				BloodBulletMono component = projectile.GetComponent<BloodBulletMono>();
				if ((Object)(object)component != (Object)null)
				{
					Object.Destroy((Object)(object)component);
				}
			};
		}

		protected override string GetTitle()
		{
			return "Blood Bullets";
		}

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

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

		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
			//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
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[4]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Life steal",
					amount = "",
					simepleAmount = (SimpleAmount)2
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Splash DMG",
					amount = "",
					simepleAmount = (SimpleAmount)2
				},
				new CardInfoStat
				{
					positive = false,
					stat = "HP",
					amount = "",
					simepleAmount = (SimpleAmount)5
				},
				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)0;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	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 ClusterBomb : CustomCard
	{
		public static int GetClusterBombCount(Player player)
		{
			return player.data.currentCards.Count((CardInfo card) => card.cardName == "Cluster Bomb");
		}

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			Player player2 = player;
			List<ObjectsToSpawn> list = gun.objectsToSpawn.ToList();
			ObjectsToSpawn item = ((GameObject)Resources.Load("0 cards/Timed Detonation")).GetComponent<Gun>().objectsToSpawn[0];
			list.Add(item);
			gun.objectsToSpawn = list.ToArray();
			gun.numberOfProjectiles += 2;
			gun.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(gun.ShootPojectileAction, (Action<GameObject>)delegate(GameObject projectile)
			{
				if (!Object.op_Implicit((Object)(object)projectile.gameObject.GetComponent<ClusterSpawner>()))
				{
					ClusterSpawner clusterSpawner = projectile.gameObject.AddComponent<ClusterSpawner>();
					clusterSpawner.spawnerGameObject = ((Component)player2).gameObject;
					int clusterBombCount = GetClusterBombCount(player2);
					clusterSpawner.minExplosionCount += Mathf.CeilToInt(2f * (float)(clusterBombCount - 1));
					clusterSpawner.maxExplosionCount += Mathf.CeilToInt(4f * (float)(clusterBombCount - 1));
					clusterSpawner.explosionDamage += 5f * (float)(clusterBombCount - 1);
				}
			});
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			gun.ShootPojectileAction = delegate(GameObject projectile)
			{
				ClusterSpawner component = projectile.GetComponent<ClusterSpawner>();
				if ((Object)(object)component != (Object)null)
				{
					Object.Destroy((Object)(object)component);
				}
			};
		}

		protected override string GetTitle()
		{
			return "Cluster Bomb";
		}

		protected override string GetDescription()
		{
			return "Bullets spawn timed bombs that spawn small clustered explosives.";
		}

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

		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 = "Bullets",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "DMG",
					amount = "",
					simepleAmount = (SimpleAmount)5
				},
				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)0;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	internal class CursedCoinFlip : CustomCard
	{
		public class CoinFlipVisual : MonoBehaviour
		{
			private TextMeshProUGUI description;

			private List<Rarity> cyclingRarities = new List<Rarity>
			{
				(Rarity)1,
				RarityUtils.GetRarity("Exotic"),
				(Rarity)2
			};

			private int currentRarityIndex = 0;

			private float cycleInterval = 2f;

			private float nextCycleMarker = 0f;

			private void Start()
			{
				description = ((IEnumerable<TextMeshProUGUI>)((Component)this).GetComponentsInChildren<TextMeshProUGUI>()).FirstOrDefault((Func<TextMeshProUGUI, bool>)((TextMeshProUGUI obj) => ((Object)((Component)obj).gameObject).name == "EffectText"));
			}

			private void Update()
			{
				if (!((Object)(object)description == (Object)null) && Time.time >= nextCycleMarker)
				{
					UpdateDescription();
					currentRarityIndex = (currentRarityIndex + 1) % cyclingRarities.Count;
					nextCycleMarker = Time.time + cycleInterval;
				}
			}

			private void UpdateDescription()
			{
				//IL_000d: 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_0013: 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_0025: 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_004c: 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_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				Rarity val = cyclingRarities[currentRarityIndex];
				Color val2 = RarityUtils.GetRarityData(val).color;
				if (val == RarityUtils.GetRarity("Exotic"))
				{
					val2 = CuzExoticDarkAsShit(val2, 0.25f);
				}
				string text = $"<color=#{ColorUtility.ToHtmlStringRGB(val2)}>{val}</color>";
				string text2 = "#8B0000";
				((TMP_Text)description).text = "<i><b>Flip the coin...</i></b>                               Gain +2 " + text + " cards or +2 <color=" + text2 + ">Curses</color>.";
			}

			private Color CuzExoticDarkAsShit(Color color, float t)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: 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_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				return Color.Lerp(color, Color.white, t);
			}
		}

		public override void Callback()
		{
			CoinFlipVisual coinFlipVisual = ((Component)this).gameObject.AddComponent<CoinFlipVisual>();
		}

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Player player2 = player;
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)CalciumCards.instance, 0.5f, (Action)delegate
			{
				//IL_0117: Unknown result type (might be due to invalid IL or missing references)
				//IL_0123: Unknown result type (might be due to invalid IL or missing references)
				//IL_012f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0169: Unknown result type (might be due to invalid IL or missing references)
				//IL_016e: Unknown result type (might be due to invalid IL or missing references)
				bool flag = Random.value < 0.5f;
				List<string> bannedCards = new List<string> { "Cursed Coin", "Ctrl Z" };
				if (flag)
				{
					List<CardInfo> list = (from kvp in CardManager.cards
						where CurseManager.instance.IsCurse(kvp.Value.cardInfo) && CardManager.IsCardActive(kvp.Value.cardInfo)
						select kvp.Value.cardInfo).ToList();
					if (list.Count != 0)
					{
						for (int i = 0; i < 2; i++)
						{
							CardInfo val = list[Random.Range(0, list.Count)];
							Cards.instance.AddCardToPlayer(player2, val, false, "", 2f, 2f, true);
							CardBarUtils.instance.ShowAtEndOfPhase(player2, val);
						}
					}
				}
				else
				{
					List<Rarity> list2 = new List<Rarity>
					{
						Rarities.Uncommon,
						Rarities.Exotic,
						Rarities.Rare
					};
					List<CardInfo> list3 = new List<CardInfo>();
					int num = 0;
					while (list3.Count == 0 && num < 10)
					{
						Rarity chosenRarity = list2[Random.Range(0, list2.Count)];
						list3 = (from kvp in CardManager.cards
							where !CurseManager.instance.IsCurse(kvp.Value.cardInfo) && kvp.Value.cardInfo.rarity == chosenRarity && CardManager.IsCardActive(kvp.Value.cardInfo) && !bannedCards.Contains(kvp.Value.cardInfo.cardName)
							select kvp.Value.cardInfo).ToList();
						num++;
					}
					if (list3.Count != 0)
					{
						for (int j = 0; j < 2; j++)
						{
							CardInfo val2 = list3[Random.Range(0, list3.Count)];
							Cards.instance.AddCardToPlayer(player2, val2, false, "", 2f, 2f, true);
							CardBarUtils.instance.ShowAtEndOfPhase(player2, val2);
						}
					}
				}
			});
		}

		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 "Cursed Coin";
		}

		protected override string GetDescription()
		{
			return "<i><b>Flip the coin...</i></b>                               Gain +2 Uncommon, Exotic, Rare cards or +2 Curses.";
		}

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

		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 CardInfoStat[] GetStats()
		{
			return (CardInfoStat[])(object)new CardInfoStat[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)4;
		}

		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