Decompiled source of Supcom2Cards v1.3.9

Supcom2Cards.dll

Decompiled 4 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.Extensions;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.RoundsEffects;
using ModdingUtils.Utils;
using ModsPlus;
using On;
using Sonigon;
using Supcom2Cards.Cards;
using Supcom2Cards.MonoBehaviours;
using Supcom2Cards.RoundsEffects;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Supcom2Cards")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Supcom2Cards")]
[assembly: AssemblyTitle("Supcom2Cards")]
[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;
		}
	}
}
public class ProtoBrainEffect : MonoBehaviour
{
	public Player player;

	public void Start()
	{
		player = ((Component)this).gameObject.GetComponentInParent<Player>();
	}
}
public class TempExtraPicks : MonoBehaviour
{
	[SerializeField]
	public int ExtraPicks;

	internal static IEnumerator HandleExtraPicks()
	{
		Player[] array = PlayerManager.instance.players.ToArray();
		foreach (Player player in array)
		{
			TempExtraPicks[] componentsInChildren = ((Component)player).GetComponentsInChildren<TempExtraPicks>();
			if (componentsInChildren.Sum((TempExtraPicks e) => e.ExtraPicks) > 0)
			{
				componentsInChildren.Where((TempExtraPicks e) => e.ExtraPicks > 0).First().ExtraPicks--;
				yield return GameModeManager.TriggerHook("PlayerPickStart");
				CardChoiceVisuals.instance.Show((from i in Enumerable.Range(0, PlayerManager.instance.players.Count)
					where PlayerManager.instance.players[i].playerID == player.playerID
					select i).First(), true);
				yield return CardChoice.instance.DoPick(1, player.playerID, (PickerType)1);
				yield return (object)new WaitForSecondsRealtime(0.1f);
				yield return GameModeManager.TriggerHook("PlayerPickEnd");
				yield return (object)new WaitForSecondsRealtime(0.1f);
			}
		}
	}
}
namespace Supcom2Cards
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.alphahex.rounds.supcom2cards", "Supcom2 Cards", "1.3.9")]
	[BepInProcess("Rounds.exe")]
	public class Supcom2 : BaseUnityPlugin
	{
		public const string Version = "1.3.9";

		private const string ModId = "com.alphahex.rounds.supcom2cards";

		private const string ModName = "Supcom2 Cards";

		public const string ModInitials = "SC2";

		public static Dictionary<string, GameObject> CardArt = new Dictionary<string, GameObject>();

		public static bool PickPhase = false;

		public static Supcom2? Instance { get; private set; }

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("com.alphahex.rounds.supcom2cards").PatchAll();
			GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)GameEnd);
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd);
			GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)PointStart);
			GameModeManager.AddHook("RoundEnd", (Func<IGameModeHandler, IEnumerator>)RoundEnd);
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => TempExtraPicks.HandleExtraPicks()));
		}

		private void Start()
		{
			LoadCardArt();
			CustomCard.BuildCard<Afterburn>();
			CustomCard.BuildCard<BombBouncer>();
			CustomCard.BuildCard<Buhbledow>();
			CustomCard.BuildCard<ChromeShield>();
			CustomCard.BuildCard<ClusterBomb>();
			CustomCard.BuildCard<Colossus>();
			CustomCard.BuildCard<Crahdow>();
			CustomCard.BuildCard<Darkenoid>();
			CustomCard.BuildCard<Disruptor>();
			CustomCard.BuildCard<DynamicPowerShunt>();
			CustomCard.BuildCard<Fatboy>();
			CustomCard.BuildCard<Fistoosh>();
			CustomCard.BuildCard<HalfBaked>();
			CustomCard.BuildCard<Harden>();
			CustomCard.BuildCard<Harvog>();
			CustomCard.BuildCard<Hunker>();
			CustomCard.BuildCard<Jackhammer>();
			CustomCard.BuildCard<JumpJets>();
			CustomCard.BuildCard<Loyalist>();
			CustomCard.BuildCard<Magnetron>();
			CustomCard.BuildCard<Megalith>();
			CustomCard.BuildCard<Overcharge>();
			CustomCard.BuildCard<Poseidon>();
			CustomCard.BuildCard<Pulinsmash>();
			CustomCard.BuildCard<QuantumForceBlast>();
			CustomCard.BuildCard<QuantumSponge>();
			CustomCard.BuildCard<RateOfFire>();
			CustomCard.BuildCard<Recycler>();
			CustomCard.BuildCard<RockHead>();
			CustomCard.BuildCard<RogueNanites>();
			CustomCard.BuildCard<Shotja>();
			CustomCard.BuildCard<StackedCannons>();
			CustomCard.BuildCard<SuperTriton>();
			CustomCard.BuildCard<Titan>();
			CustomCard.BuildCard<Tml>();
			CustomCard.BuildCard<Training>();
			CustomCard.BuildCard<Urchinow>();
			CustomCard.BuildCard<Wilfindja>();
			Instance = this;
		}

		private void LoadCardArt()
		{
			List<string> assetNames = new List<string> { "ClusterBomb", "Colossus", "Darkenoid", "Disruptor", "Magnetron", "Megalith", "Poseidon", "Shotja", "Tml" };
			List<string> assetNames2 = new List<string>
			{
				"Afterburn", "Buhbledow", "ChromeShield", "Crahdow", "DynamicPowerShunt", "Fatboy", "FieldEngineer", "Fistoosh", "HalfBaked", "Harden",
				"Harvog", "Hunker", "Jackhammer", "JumpJets", "Loyalist", "Overcharge", "Poseidon", "Pulinsmash", "QuantumForceBlast", "QuantumSponge",
				"RateOfFire", "Recycler", "RockHead", "RogueNanites", "StackedCannons", "SuperTriton", "Titan", "Training", "Urchinow", "Wilfindja"
			};
			List<string> assetNames3 = new List<string> { "BombBouncer" };
			CardArt.LoadArt("Supcom2Art_1", assetNames);
			CardArt.LoadArt("Supcom2Art_2", assetNames2);
			CardArt.LoadArt("sc2test", assetNames3);
		}

		public static void Log(string word)
		{
			Debug.Log((object)word);
		}

		public static (GameObject AddToProjectile, GameObject effect, Explosion explosion) LoadExplosion(string name, Gun? gun = null)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			Gun component = ((GameObject)Resources.Load("0 cards/Explosive bullet")).GetComponent<Gun>();
			if ((Object)(object)gun != (Object)null)
			{
				gun.soundGun.AddSoundImpactModifier(component.soundImpactModifier);
			}
			GameObject addToProjectile = component.objectsToSpawn[0].AddToProjectile;
			GameObject val = Object.Instantiate<GameObject>(component.objectsToSpawn[0].effect);
			val.transform.position = new Vector3(1000f, 0f, 0f);
			((Object)val).hideFlags = (HideFlags)61;
			((Object)val).name = name;
			Object.DestroyImmediate((Object)(object)val.GetComponent<RemoveAfterSeconds>());
			Explosion component2 = val.GetComponent<Explosion>();
			return (addToProjectile, val, component2);
		}

		public List<int> GetRoundWinners()
		{
			return new List<int>(GameModeManager.CurrentHandler.GetRoundWinners());
		}

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

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

		private IEnumerator PointStart(IGameModeHandler gm)
		{
			PickPhase = false;
			BombBouncerEffect[] array = Object.FindObjectsOfType<BombBouncerEffect>();
			for (int i = 0; i < array.Length; i++)
			{
				array[i].Charge = 0f;
			}
			HalfBakedEffect[] array2 = Object.FindObjectsOfType<HalfBakedEffect>();
			for (int i = 0; i < array2.Length; i++)
			{
				array2[i].player.data.silenceTime = 0f;
			}
			JumpJetsEffect[] array3 = Object.FindObjectsOfType<JumpJetsEffect>();
			for (int i = 0; i < array3.Length; i++)
			{
				array3[i].Refuel();
			}
			RadarJammerEffect[] array4 = Object.FindObjectsOfType<RadarJammerEffect>();
			for (int i = 0; i < array4.Length; i++)
			{
				array4[i].RemoveJammed();
			}
			yield break;
		}

		private IEnumerator RoundEnd(IGameModeHandler gm)
		{
			List<int> roundWinners = GetRoundWinners();
			ProtoBrainEffect[] array = Object.FindObjectsOfType<ProtoBrainEffect>();
			foreach (ProtoBrainEffect protoBrainEffect in array)
			{
				if (roundWinners.Contains(protoBrainEffect.player.teamID))
				{
					ExtensionMethods.GetOrAddComponent<TempExtraPicks>(((Component)protoBrainEffect.player).gameObject, false).ExtraPicks++;
				}
			}
			yield break;
		}
	}
	public static class ExtensionMethods
	{
		private static readonly float MAX_SPEED = 0.01f;

		public static float CooldownRatio(this Block block)
		{
			if (block.counter > block.Cooldown())
			{
				return 1f;
			}
			return block.counter / block.Cooldown();
		}

		public static float DPS(this Gun gun)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			GunAmmo val = (GunAmmo)ExtensionMethods.GetFieldValue((object)gun, "gunAmmo");
			return 55f * gun.damage / gun.attackSpeed * ((float)val.maxAmmo * gun.attackSpeed / ((2f + val.reloadTimeAdd) * val.reloadTimeMultiplier));
		}

		public static void RemovePlayerDiedAction(this PlayerManager pm, Action<Player, int> listener)
		{
			_ = (Action<Player, int>)Delegate.Remove((Action<Player, int>)ExtensionMethods.GetFieldValue((object)pm, "PlayerDiedAction"), listener);
		}

		public static void SetListCount<T>(this List<T> list, int count) where T : new()
		{
			int count2 = list.Count;
			if (count > count2)
			{
				for (int i = 0; i < count - count2; i++)
				{
					list.Add(new T());
				}
			}
			else if (count2 > count)
			{
				for (int j = 0; j < count2 - count; j++)
				{
					list.RemoveAt(0);
				}
			}
		}

		public static void TakeDamage(this Player player, float damage, Player? damagingPlayer = null)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			CharacterData data = player.data;
			data.health -= damage;
			if (player.data.health <= 0f)
			{
				((Damagable)player.data.healthHandler).TakeDamage(Vector2.up, Vector2.op_Implicit(((Component)player.data).transform.position), (GameObject)null, damagingPlayer, true, true);
			}
		}

		public static void LoadArt(this Dictionary<string, GameObject> CardArt, string bundleName, List<string> assetNames)
		{
			AssetBundle val = AssetUtils.LoadAssetBundleFromResources(bundleName, typeof(Supcom2).Assembly);
			foreach (string assetName in assetNames)
			{
				GameObject val2 = val.LoadAsset<GameObject>("C_" + assetName);
				if ((Object)(object)val2 != (Object)null)
				{
					CardArt.Add(assetName, val2);
				}
			}
		}

		public static int CurrentAmmo(this GunAmmo gunAmmo)
		{
			return (int)ExtensionMethods.GetFieldValue((object)gunAmmo, "currentAmmo");
		}

		public static int CurrentAmmoAdd(this GunAmmo gunAmmo, int add)
		{
			if (add == 0)
			{
				return 0;
			}
			int num = gunAmmo.CurrentAmmo();
			int num2 = num + add;
			if (num2 < 0)
			{
				num2 = 0;
			}
			if (num2 > gunAmmo.maxAmmo)
			{
				num2 = gunAmmo.maxAmmo;
			}
			ExtensionMethods.SetFieldValue((object)gunAmmo, "currentAmmo", (object)num2);
			return num2 - num;
		}

		public static Gun Gun(this Player player)
		{
			return player.data.weaponHandler.gun;
		}

		public static GunAmmo GunAmmo(this Gun gun)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return (GunAmmo)ExtensionMethods.GetFieldValue((object)gun, "gunAmmo");
		}

		public static float ReloadTime(this GunAmmo gunAmmo)
		{
			return (gunAmmo.reloadTime + gunAmmo.reloadTimeAdd) * gunAmmo.reloadTimeMultiplier;
		}

		public static void SetActiveBullets(this GunAmmo gunAmmo, bool forceTurnOn = false)
		{
			typeof(GunAmmo).InvokeMember("SetActiveBullets", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, gunAmmo, new object[1] { forceTurnOn });
		}

		public static void UpdateAmmo(this Gun gun)
		{
			GunAmmo val = gun.GunAmmo();
			int num = val.CurrentAmmo();
			if (num <= 0)
			{
				return;
			}
			if (gun.isReloading)
			{
				float num2 = (float)ExtensionMethods.GetFieldValue((object)val, "reloadCounter");
				float num3 = val.ReloadTime() - num2;
				ExtensionMethods.SetFieldValue((object)val, "freeReloadCounter", (object)num3);
				ExtensionMethods.SetFieldValue((object)val, "reloadCounter", (object)num2);
				val.ReloadAmmo(true);
				ExtensionMethods.SetFieldValue((object)val, "currentAmmo", (object)num);
			}
			for (int num4 = ((Component)val.populate).transform.childCount - 1; num4 >= 0; num4--)
			{
				if (((Component)((Component)val.populate).transform.GetChild(num4)).gameObject.activeSelf)
				{
					Object.Destroy((Object)(object)((Component)((Component)val.populate).transform.GetChild(num4)).gameObject);
				}
			}
			val.populate.times = val.CurrentAmmo();
			val.populate.DoPopulate();
			val.SetActiveBullets(forceTurnOn: true);
		}

		public static bool StandingStill(this Player player, ref Vector3 lastPosition)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			if (player.data.isGrounded || player.data.isWallGrab)
			{
				float num = ((Component)player).transform.position.x - lastPosition.x;
				num = ((num > 0f) ? num : (0f - num));
				float num2 = ((Component)player).transform.position.y - lastPosition.y;
				num2 = ((num2 > 0f) ? num2 : (0f - num2));
				lastPosition = ((Component)player).transform.position;
				return num * num + num2 * num2 < MAX_SPEED;
			}
			lastPosition = ((Component)player).transform.position;
			return false;
		}

		public static T IncrementCardEffect<T>(this Player player) where T : Component, ISingletonEffect
		{
			T val = ((Component)player).gameObject.GetComponent<T>();
			if ((Object)(object)val == (Object)null)
			{
				val = ((Component)player).gameObject.AddComponent<T>();
			}
			val.CardAmount++;
			ISingletonEffect.All.Add((Object)(object)val);
			return val;
		}

		public static T? DecrementCardEffect<T>(this Player player) where T : Component, ISingletonEffect
		{
			T component = ((Component)player).gameObject.GetComponent<T>();
			component.CardAmount--;
			if (component.CardAmount < 1)
			{
				Object.Destroy((Object)(object)component);
				ISingletonEffect.All.Remove((Object)(object)component);
				return default(T);
			}
			return component;
		}
	}
	public interface ISingletonEffect
	{
		static readonly List<Object> All;

		int CardAmount { get; set; }

		static void GameEnd()
		{
			foreach (Object item in All)
			{
				Object.Destroy(item);
			}
		}

		static ISingletonEffect()
		{
			All = new List<Object>();
		}
	}
	public class Laser
	{
		private Color _color = Color.magenta;

		private Material _material = new Material(Shader.Find("UI/Default"));

		private float _width = 0.3f;

		private float _z = -5f;

		private readonly LineRenderer line;

		private readonly Vector3[] cords = (Vector3[])(object)new Vector3[2];

		public Color Color
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return _color;
			}
			set
			{
				//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_0013: Unknown result type (might be due to invalid IL or missing references)
				_color = value;
				((Renderer)line).material.color = Color;
			}
		}

		public Material Material
		{
			get
			{
				return _material;
			}
			set
			{
				_material = value;
				((Renderer)line).material = Material;
			}
		}

		public string Name
		{
			get
			{
				return ((Object)line).name;
			}
			set
			{
				((Object)line).name = value;
			}
		}

		public float Width
		{
			get
			{
				return _width;
			}
			set
			{
				_width = value;
				line.startWidth = Width;
				line.endWidth = Width;
			}
		}

		public float Z
		{
			get
			{
				return _z;
			}
			set
			{
				_z = value;
				cords[0].z = Z;
				cords[1].z = Z;
			}
		}

		public Laser()
		{
			//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_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			line = new GameObject().AddComponent<LineRenderer>();
			line.startColor = Color.white;
			line.endColor = Color.white;
			line.useWorldSpace = true;
			((Renderer)line).material.color = Color;
			((Renderer)line).material = Material;
			Name = "Laser";
			line.startWidth = Width;
			line.endWidth = Width;
			cords[0].z = Z;
			cords[1].z = Z;
		}

		~Laser()
		{
			Object.Destroy((Object)(object)line);
		}

		public void Draw(float x1, float y1, float x2, float y2)
		{
			cords[0].x = x1;
			cords[0].y = y1;
			cords[1].x = x2;
			cords[1].y = y2;
			line.SetPositions(cords);
		}

		public void Draw(Vector3 a, Vector3 b)
		{
			//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)
			//IL_000d: 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)
			Draw(a.x, a.y, b.x, b.y);
		}

		public void DrawHidden()
		{
			Draw(100f, 100f, 100f, 100f);
		}
	}
	public static class RNG
	{
		public enum Distribution
		{
			Uniform,
			Exponential
		}

		private static uint seed = 3877386580u;

		private const decimal m = 0.0000000000000000000542101086m;

		private const double d = 5.421010862427522E-20;

		private const float f = 2.3283064E-10f;

		public static bool NextBool()
		{
			return (NextUInt() & 1) == 1;
		}

		public static byte NextByte()
		{
			return BitConverter.GetBytes(NextUInt())[0];
		}

		public static byte[] NextBytes(int size)
		{
			byte[] array = new byte[size];
			byte[] array2 = new byte[4];
			for (int i = 0; i < size; i++)
			{
				if (i % 4 == 0)
				{
					array2 = BitConverter.GetBytes(NextUInt());
				}
				array[i] = array2[i % 4];
			}
			return array;
		}

		public static decimal NextDecimal(Distribution distribution = Distribution.Uniform)
		{
			decimal num = (decimal)NextULong() * 0.0000000000000000000542101086m;
			return distribution switch
			{
				Distribution.Uniform => num, 
				Distribution.Exponential => num * NextDecimal(), 
				_ => throw new NotImplementedException($"NextDecimal() {distribution} Distribution not implemented"), 
			};
		}

		public static decimal NextDecimal(decimal min, decimal max, Distribution distribution = Distribution.Uniform)
		{
			return NextDecimal(distribution) * (max - min) + min;
		}

		public static double NextDouble(Distribution distribution = Distribution.Uniform)
		{
			double num = (double)NextULong() * 5.421010862427522E-20;
			if (num == double.NaN || num == double.NegativeInfinity || num == double.PositiveInfinity)
			{
				num = NextDouble();
			}
			return distribution switch
			{
				Distribution.Uniform => num, 
				Distribution.Exponential => num * NextDouble(), 
				_ => throw new NotImplementedException($"NextDouble() {distribution} Distribution not implemented"), 
			};
		}

		public static double NextDouble(double min, double max, Distribution distribution = Distribution.Uniform)
		{
			return NextDouble(distribution) * (max - min) + min;
		}

		public static float NextFloat(Distribution distribution = Distribution.Uniform)
		{
			float num = (float)NextUInt() * 2.3283064E-10f;
			if (num == float.NaN || num == float.NegativeInfinity || num == float.PositiveInfinity)
			{
				num = NextFloat();
			}
			return distribution switch
			{
				Distribution.Uniform => num, 
				Distribution.Exponential => num * NextFloat(), 
				_ => throw new NotImplementedException($"NextFloat() {distribution} Distribution not implemented"), 
			};
		}

		public static float NextFloat(float min, float max, Distribution distribution = Distribution.Uniform)
		{
			return NextFloat(distribution) * (max - min) + min;
		}

		public static int NextInt()
		{
			return (int)NextUInt();
		}

		public static int NextInt(int min, int max)
		{
			uint max2 = (uint)(max - min);
			return (int)NextUInt(0u, max2) + min;
		}

		public static uint NextUInt()
		{
			uint num = (seed >> 27) ^ (seed >> 11) ^ (seed >> 6) ^ (seed >> 5);
			seed = (seed << 1) | (num & 1u);
			return seed;
		}

		public static uint NextUInt(uint min, uint max)
		{
			uint num = max - min;
			ulong num2 = (ulong)(((long)num + 1L) * NextUInt()) / 4294967295uL;
			if (num2 <= num)
			{
				return (uint)(int)num2 + min;
			}
			return num + min;
		}

		public static long NextLong()
		{
			return (long)NextULong();
		}

		public static ulong NextULong()
		{
			return BitConverter.ToUInt64(NextBytes(8), 0);
		}

		public static short NextShort()
		{
			return (short)NextUShort();
		}

		public static ushort NextUShort()
		{
			return BitConverter.ToUInt16(NextBytes(2), 0);
		}

		public static void Reset()
		{
			seed = 3877386580u;
		}

		private static uint NextBinary()
		{
			uint num = 0u;
			for (int i = 0; i < 32; i++)
			{
				num |= (NextUInt() & 1) << i;
			}
			return num;
		}
	}
}
namespace Supcom2Cards.RoundsEffects
{
	public class BuhbledowEffect : HitEffect, ISingletonEffect
	{
		public Player Owner;

		public int CardAmount { get; set; }

		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer)
		{
			if (!((Object)(object)this == (Object)null))
			{
				Block block = damagedPlayer.data.block;
				if (!block.IsBlocking() && block.IsOnCD())
				{
					block.counter *= 0.5f;
				}
			}
		}
	}
	public class ClusterBombEffect : HitSurfaceEffect, ISingletonEffect
	{
		public Explosion Explosion;

		public ObjectsToSpawn ExplosionToSpawn;

		public Gun gun;

		public static SoundEvent sound;

		public int CardAmount { get; set; }

		private void Explode(Vector2 position)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			double num = RNG.NextDouble(0.0, Math.PI * 2.0);
			Vector2 val = new Vector2((float)Math.Cos(num), (float)Math.Sin(num)) * (float)RNG.NextInt(0, ClusterBomb.EXPLOSION_SPREAD);
			Object.Destroy((Object)(object)Object.Instantiate<GameObject>(ExplosionToSpawn.effect, Vector2.op_Implicit(position + val), Quaternion.identity), 2f);
			SoundManager.Instance.Play(sound, ((Component)this).transform);
		}

		public override void Hit(Vector2 position, Vector2 normal, Vector2 velocity)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Explosion.damage = ClusterBomb.EXPLOSION_DMG_MULT * gun.damage;
			((MonoBehaviour)Supcom2.Instance).StartCoroutine(IDoExplosions(position));
		}

		public IEnumerator IDoExplosions(Vector2 position)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < ClusterBomb.EXPLOSION_AMOUNT * CardAmount; i++)
			{
				Explode(position);
				int delay = (int)RNG.NextFloat(1f, ClusterBomb.FRAMES_MAX);
				for (int frame = 0; frame < delay; frame++)
				{
					yield return null;
				}
			}
		}
	}
	public class CrahdowEffect : HitEffect, ISingletonEffect
	{
		public Player Owner;

		public int CardAmount { get; set; }

		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer)
		{
			if (!((Object)(object)this == (Object)null) && !damagedPlayer.data.isGrounded && !damagedPlayer.data.isWallGrab)
			{
				damagedPlayer.TakeDamage((float)(Math.Pow(Crahdow.DMG_BOOST, CardAmount) - 1.0) * ((Vector2)(ref damage)).magnitude);
			}
		}
	}
	public class FistooshEffect : HitEffect, ISingletonEffect
	{
		public Player Owner;

		public int CardAmount { get; set; }

		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer)
		{
			if (!((Object)(object)this == (Object)null) && (damagedPlayer.data.isGrounded || damagedPlayer.data.isWallGrab))
			{
				damagedPlayer.TakeDamage((float)(Math.Pow(Fistoosh.DMG_BOOST, CardAmount) - 1.0) * ((Vector2)(ref damage)).magnitude);
			}
		}
	}
	public class PulinsmashEffect : HitEffect, ISingletonEffect
	{
		public Player Owner;

		public int CardAmount { get; set; }

		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: 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)
			if (!((Object)(object)this == (Object)null) && !Owner.data.dead && (Object)(object)damagedPlayer != (Object)(object)Owner)
			{
				Vector2 val = Vector2.op_Implicit(((Component)Owner).transform.position - ((Component)damagedPlayer).transform.position);
				damagedPlayer.data.healthHandler.TakeForce(10f * ((Vector2)(ref damage)).magnitude * val, (ForceMode2D)1, false, false, 0f);
				val *= 0.5f;
				ExtensionMethods.AddXPosition(((Component)damagedPlayer).transform, val.x);
				ExtensionMethods.AddYPosition(((Component)damagedPlayer).transform, val.y);
				SoundManager.Instance.Play(Owner.data.block.soundBlockStatusEffect, ((Component)damagedPlayer).transform);
			}
		}
	}
	public class QuantumForceBlastEffect : WasHitEffect, ISingletonEffect
	{
		public Player Owner;

		public int CardAmount { get; set; }

		public override void WasDealtDamage(Vector2 damage, bool selfDamage)
		{
			SoundManager.Instance.Play(Owner.data.playerSounds.soundCharacterDamageScreenEdge, ((Component)this).transform);
		}
	}
	public class RecyclerEffect : HitEffect, ISingletonEffect
	{
		public Player Owner;

		public int CardAmount { get; set; }

		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer)
		{
			if (!((Object)(object)this == (Object)null || selfDamage) && damagedPlayer.Gun().GunAmmo().CurrentAmmo() > 0)
			{
				int add = -damagedPlayer.Gun().GunAmmo().CurrentAmmoAdd(-Recycler.AMMO_STEAL * CardAmount);
				damagedPlayer.Gun().UpdateAmmo();
				Owner.Gun().GunAmmo().CurrentAmmoAdd(add);
				Owner.Gun().UpdateAmmo();
			}
		}
	}
}
namespace Supcom2Cards.MonoBehaviours
{
	public class AfterburnEffect : CounterReversibleEffect, ISingletonEffect
	{
		private float counter;

		private bool modifiersActive;

		public int CardAmount { get; set; }

		public void Activate()
		{
			counter += 2f * (float)CardAmount;
			SoundManager.Instance.Play(((ReversibleEffect)this).player.data.block.soundBlockStatusEffect, ((Component)((ReversibleEffect)this).block).transform);
		}

		public override CounterStatus UpdateCounter()
		{
			counter -= TimeHandler.deltaTime;
			if (!modifiersActive && counter > 0f)
			{
				return (CounterStatus)0;
			}
			if (counter <= 0f)
			{
				((CounterReversibleEffect)this).Reset();
				return (CounterStatus)2;
			}
			return (CounterStatus)1;
		}

		public override void UpdateEffects()
		{
			((ReversibleEffect)this).characterStatModifiersModifier.movementSpeed_mult = 2f;
		}

		public override void OnApply()
		{
			modifiersActive = true;
		}

		public override void OnRemove()
		{
			modifiersActive = false;
		}

		public override void Reset()
		{
			counter = 0f;
			modifiersActive = false;
		}

		public override void OnStart()
		{
			((ReversibleEffect)this).applyImmediately = false;
			((ReversibleEffect)this).SetLivesToEffect(int.MaxValue);
			Block block = ((ReversibleEffect)this).block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		public override void OnOnDestroy()
		{
			Block block = ((ReversibleEffect)this).block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			//IL_0000: 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)
			//IL_0005: Invalid comparison between Unknown and I4
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			if ((int)trigger == 0 || (int)trigger == 3 || (int)trigger == 2)
			{
				Activate();
			}
		}
	}
	public class BombBouncerEffect : MonoBehaviour, ISingletonEffect
	{
		private float _charge;

		public ObjectsToSpawn? Explosion;

		public Explosion ExplosionData;

		public Player player;

		public Block block;

		private CustomHealthBar chargeBar;

		public int CardAmount { get; set; }

		public float Charge
		{
			get
			{
				return _charge;
			}
			set
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				_charge = value;
				if (_charge >= ChargeMax)
				{
					_charge = ChargeMax;
				}
				chargeBar.SetColor((_charge < ChargeMax) ? BombBouncer.COLOR_UNCHARGED : BombBouncer.COLOR_CHARGED);
			}
		}

		public float ChargeMax => player.data.maxHealth * (float)CardAmount * 1.5f;

		public void Start()
		{
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: 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)
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			block = ((Component)player).GetComponent<Block>();
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
			CharacterStatModifiers stats = player.data.stats;
			stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Combine(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage));
			PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied);
			Transform transform = ((Component)((Component)player).GetComponentInChildren<PlayerWobblePosition>()).transform;
			GameObject val = new GameObject("Bomb Bouncer Charge Bar");
			val.transform.SetParent(transform);
			chargeBar = val.AddComponent<CustomHealthBar>();
			((Component)chargeBar).transform.localPosition = Vector3.up * 0.25f;
			((Component)chargeBar).transform.localScale = Vector3.one;
			chargeBar.SetColor(BombBouncer.COLOR_UNCHARGED);
		}

		public void Update()
		{
			if (!player.data.dead)
			{
				chargeBar.SetValues(Charge, ChargeMax);
			}
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			if (!(Charge <= 0f) && Explosion != null)
			{
				Explosion.effect.GetComponent<Explosion>().damage = Charge;
				Charge = 0f;
				GameObject obj = Object.Instantiate<GameObject>(Explosion.effect, ((Component)player.data).transform.position, Quaternion.identity);
				Transform transform = obj.transform;
				transform.localScale *= 3f * (0.25f * (float)CardAmount + 0.75f);
				Object.Destroy((Object)(object)obj, 2f);
			}
		}

		private void OnDamage(Vector2 damage, bool selfDamage)
		{
			Charge += ((Vector2)(ref damage)).magnitude * 1.5f;
		}

		public void OnDestroy()
		{
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
			CharacterStatModifiers stats = player.data.stats;
			stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Remove(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage));
			PlayerManager.instance.RemovePlayerDiedAction(PlayerDied);
		}

		private void PlayerDied(Player p, int idk)
		{
			if ((Object)(object)p == (Object)(object)player)
			{
				Charge = 0f;
			}
		}
	}
	public class ChromeShieldEffect : MonoBehaviour, ISingletonEffect
	{
		public Player player;

		public Block block;

		public int CardAmount { get; set; }

		public void Start()
		{
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			block = ((Component)player).GetComponent<Block>();
			CharacterStatModifiers stats = player.data.stats;
			stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Combine(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage));
		}

		public void OnDestroy()
		{
			CharacterStatModifiers stats = player.data.stats;
			stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Remove(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage));
		}

		private void OnDamage(Vector2 damage, bool selfDamage)
		{
			if (!block.IsOnCD() && player.data.silenceTime < 0.01f && HalfBakedEffect.TryBlock(player))
			{
				CharacterData data = player.data;
				data.health += ((Vector2)(ref damage)).magnitude;
				QuantumSpongeEffect component = ((Component)player).gameObject.GetComponent<QuantumSpongeEffect>();
				if ((Object)(object)component != (Object)null)
				{
					component.ChromeShielded = true;
				}
				block.TryBlock();
				blocked();
			}
		}

		private void blocked()
		{
			SoundManager.Instance.Play(block.soundBlockBlocked, ((Component)block).transform);
		}
	}
	public class DarkenoidEffect : MonoBehaviour, ISingletonEffect
	{
		public Player player;

		public Block block;

		public int CardAmount { get; set; }

		public void Start()
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			block = ((Component)player).GetComponent<Block>();
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
			ForceShootDir(new Vector3(0f, -1f, 0f));
		}

		public void OnDestroy()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
			ForceShootDir(new Vector3(0f, 0f, 0f));
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			((MonoBehaviour)Supcom2.Instance).StartCoroutine(IDoForceShootDir());
		}

		public IEnumerator IDoForceShootDir()
		{
			for (int i = 0; i < PlayerManager.instance.players.Count; i++)
			{
				for (int frame = 0; frame < 12; frame++)
				{
					yield return null;
				}
				ForceShootDir(new Vector3(0f, -1f, 0f));
			}
		}

		private void ForceShootDir(Vector3 dir)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			ExtensionMethods.SetFieldValue((object)player.data.weaponHandler.gun, "forceShootDir", (object)dir);
		}
	}
	public class DynamicPowerShuntEffect : MonoBehaviour, ISingletonEffect
	{
		private int _cardAmount;

		public Player player;

		public Block block;

		private bool standingStill;

		private float counterMult;

		private Vector3 lastPosition = new Vector3(0f, 0f, 0f);

		private float delay = 0.1f;

		public int CardAmount
		{
			get
			{
				return _cardAmount;
			}
			set
			{
				_cardAmount = value;
				double num = 1.0 / Math.Pow(0.25, _cardAmount);
				counterMult = (float)num;
			}
		}

		public void Update()
		{
			if (standingStill)
			{
				delay -= Time.deltaTime;
				if (delay <= 0f)
				{
					Block obj = block;
					obj.counter += Time.deltaTime * (counterMult - 1f);
				}
			}
			else
			{
				delay = 0.1f;
			}
		}

		public void FixedUpdate()
		{
			standingStill = player.StandingStill(ref lastPosition);
		}

		public void Start()
		{
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			block = ((Component)player).GetComponent<Block>();
		}
	}
	public class HalfBakedEffect : MonoBehaviour, ISingletonEffect
	{
		public Player player;

		public Block block;

		private uint chance = 1073741824u;

		private GeneralInput input;

		public int CardAmount { get; set; }

		public void Start()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			block = ((Component)player).GetComponent<Block>();
			input = (GeneralInput)ExtensionMethods.GetFieldValue((object)block, "input");
		}

		public void Update()
		{
			if (input.shieldWasPressed && !input.silencedInput && CanBlock())
			{
				TryBlock(player);
			}
		}

		public static bool TryBlock(Player player)
		{
			HalfBakedEffect component = ((Component)player).GetComponent<HalfBakedEffect>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if (RNG.NextUInt() < component.chance)
			{
				component.FailBlock();
				return false;
			}
			return true;
		}

		private void FailBlock()
		{
			CharacterData data = player.data;
			data.silenceTime += 2f * (float)CardAmount;
			Block obj = block;
			obj.sinceBlock += 0.6f;
			block.counter = 0f;
			SoundManager.Instance.Play(player.data.playerSounds.soundCharacterDamageScreenEdge, ((Component)player).transform);
		}

		private bool CanBlock()
		{
			if (!(block.counter < 0.01f))
			{
				return !block.IsOnCD();
			}
			return true;
		}
	}
	public class HardenEffect : CounterReversibleEffect, ISingletonEffect
	{
		private float counter;

		private bool modifiersActive;

		public int CardAmount { get; set; }

		public void Activate()
		{
			counter += 2.5f * (float)CardAmount;
			SoundManager.Instance.Play(((ReversibleEffect)this).player.data.block.soundBlockStatusEffect, ((Component)((ReversibleEffect)this).block).transform);
		}

		public override CounterStatus UpdateCounter()
		{
			counter -= TimeHandler.deltaTime;
			if (!modifiersActive && counter > 0f)
			{
				return (CounterStatus)0;
			}
			if (counter <= 0f)
			{
				((CounterReversibleEffect)this).Reset();
				return (CounterStatus)2;
			}
			return (CounterStatus)1;
		}

		public override void UpdateEffects()
		{
			((ReversibleEffect)this).gunStatModifier.attackSpeed_mult = 0.3333f;
			((ReversibleEffect)this).gunStatModifier.projectileSpeed_mult = 2f;
		}

		public override void OnApply()
		{
			modifiersActive = true;
		}

		public override void OnRemove()
		{
			modifiersActive = false;
		}

		public override void Reset()
		{
			counter = 0f;
			modifiersActive = false;
		}

		public override void OnStart()
		{
			((ReversibleEffect)this).applyImmediately = false;
			((ReversibleEffect)this).SetLivesToEffect(int.MaxValue);
			Block block = ((ReversibleEffect)this).block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		public override void OnOnDestroy()
		{
			Block block = ((ReversibleEffect)this).block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			//IL_0000: 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)
			//IL_0005: Invalid comparison between Unknown and I4
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			if ((int)trigger == 0 || (int)trigger == 3 || (int)trigger == 2)
			{
				Activate();
			}
		}
	}
	public class HunkerEffect : CounterReversibleEffect, ISingletonEffect
	{
		private bool modifiersActive;

		public int CardAmount { get; set; }

		public override void OnUpdate()
		{
			Block block = ((ReversibleEffect)this).block;
			block.sinceBlock -= TimeHandler.deltaTime;
			Block block2 = ((ReversibleEffect)this).block;
			block2.sinceBlock += TimeHandler.deltaTime / 2f / (float)CardAmount;
			((CounterReversibleEffect)this).OnUpdate();
		}

		public override CounterStatus UpdateCounter()
		{
			if (!modifiersActive && ((ReversibleEffect)this).block.IsBlocking())
			{
				return (CounterStatus)0;
			}
			if (!((ReversibleEffect)this).block.IsBlocking())
			{
				((CounterReversibleEffect)this).Reset();
				return (CounterStatus)2;
			}
			return (CounterStatus)1;
		}

		public override void UpdateEffects()
		{
			((ReversibleEffect)this).characterStatModifiersModifier.movementSpeed_mult = 0.25f;
		}

		public override void OnApply()
		{
			modifiersActive = true;
		}

		public override void OnRemove()
		{
			modifiersActive = false;
		}

		public override void Reset()
		{
			modifiersActive = false;
		}

		public override void OnStart()
		{
			((ReversibleEffect)this).applyImmediately = false;
		}
	}
	public class JackhammerEffect : CounterReversibleEffect, ISingletonEffect
	{
		private bool modifiersActive;

		private bool standingStill;

		private Vector3 lastPosition = new Vector3(0f, 0f, 0f);

		private float delay = 0.1f;

		public int CardAmount { get; set; }

		public override CounterStatus UpdateCounter()
		{
			if (!Supcom2.PickPhase && !modifiersActive && standingStill)
			{
				delay -= Time.deltaTime;
				if (delay < 0f)
				{
					SoundManager.Instance.Play(((ReversibleEffect)this).player.data.playerSounds.soundCharacterLandBig, ((Component)((ReversibleEffect)this).player).transform);
					SoundManager.Instance.Play(((ReversibleEffect)this).player.data.healthHandler.soundDamagePassive, ((Component)((ReversibleEffect)this).player).transform);
					return (CounterStatus)0;
				}
			}
			else if (modifiersActive && (Supcom2.PickPhase || !standingStill))
			{
				delay = 0.1f;
				return (CounterStatus)2;
			}
			return (CounterStatus)1;
		}

		public override void UpdateEffects()
		{
			((ReversibleEffect)this).gunStatModifier.damage_mult = 3f;
			((ReversibleEffect)this).characterDataModifier.maxHealth_mult = 3f;
		}

		public override void OnApply()
		{
			modifiersActive = true;
		}

		public override void OnRemove()
		{
			modifiersActive = false;
		}

		public override void Reset()
		{
			modifiersActive = false;
		}

		public override void OnStart()
		{
		}

		public override void OnFixedUpdate()
		{
			standingStill = ((ReversibleEffect)this).player.StandingStill(ref lastPosition);
		}
	}
	public class JumpJetsEffect : InAirJumpEffect, ISingletonEffect
	{
		private int _cardAmount;

		private CustomHealthBar fuelBar;

		private GeneralInput input;

		public int CardAmount
		{
			get
			{
				return _cardAmount;
			}
			set
			{
				_cardAmount = value;
				((InAirJumpEffect)this).AddJumps(10f);
			}
		}

		private float jumps => (float)ExtensionMethods.GetFieldValue((object)this, "jumps");

		private float currentJumps
		{
			get
			{
				return (float)ExtensionMethods.GetFieldValue((object)this, "currentjumps");
			}
			set
			{
				ExtensionMethods.SetFieldValue((object)this, "currentjumps", (object)value);
			}
		}

		public override void OnStart()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			((InAirJumpEffect)this).OnStart();
			((InAirJumpEffect)this).SetJumpMult(0.25f);
			((InAirJumpEffect)this).SetContinuousTrigger(true);
			((InAirJumpEffect)this).SetResetOnWallGrab(true);
			((InAirJumpEffect)this).SetCostPerJump(1f);
			((InAirJumpEffect)this).SetInterval(0.025f);
			Transform transform = ((Component)((Component)((ReversibleEffect)this).player).GetComponentInChildren<PlayerWobblePosition>()).transform;
			GameObject val = new GameObject("JumpJets Fuel Bar");
			val.transform.SetParent(transform);
			fuelBar = val.AddComponent<CustomHealthBar>();
			((Component)fuelBar).transform.localPosition = Vector3.down * 0.25f;
			((Component)fuelBar).transform.localScale = Vector3.one;
			fuelBar.SetColor(Color.gray);
			input = ((Component)((ReversibleEffect)this).player).GetComponent<GeneralInput>();
		}

		public override void OnUpdate()
		{
			((InAirJumpEffect)this).OnUpdate();
			if (!((ReversibleEffect)this).player.data.dead)
			{
				fuelBar.SetValues(currentJumps - 1f, jumps - 1f);
			}
			if (input.jumpIsPressed && !((ReversibleEffect)this).player.data.isGrounded && !((ReversibleEffect)this).player.data.isWallGrab && currentJumps > 0f)
			{
				SoundManager.Instance.Play(((ReversibleEffect)this).player.data.healthHandler.soundDamagePassive, ((Component)((ReversibleEffect)this).player).transform);
			}
		}

		public override void OnOnDestroy()
		{
			((InAirJumpEffect)this).OnOnDestroy();
			Object.Destroy((Object)(object)((Component)fuelBar).gameObject);
		}

		public void Refuel()
		{
			currentJumps = jumps;
		}
	}
	public class MagnetronEffect : MonoBehaviour, ISingletonEffect
	{
		public Player player;

		public Block block;

		private bool active;

		private float force1k;

		private float timeStarted;

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

		private float damagePerTick;

		private float healingPerTick;

		public int CardAmount { get; set; }

		public void Activate(float force)
		{
			force1k = 1000f * force;
			if (!active)
			{
				enemies = PlayerManager.instance.players.Where((Player p) => p.teamID != player.teamID).ToList();
				timeStarted = Time.time;
				active = true;
			}
		}

		public void FixedUpdate()
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			if (!active)
			{
				return;
			}
			if (Time.time - timeStarted > 3f * (float)CardAmount)
			{
				active = false;
				return;
			}
			Vector2 val3 = default(Vector2);
			foreach (Player enemy in enemies)
			{
				Vector3 val = ((Component)enemy).transform.position - ((Component)player).transform.position;
				float magnitude = ((Vector3)(ref val)).magnitude;
				((Vector3)(ref val)).Normalize();
				float num = magnitude * magnitude;
				if (num < 20f)
				{
					num = 20f;
				}
				if (num > float.MaxValue)
				{
					num = float.MaxValue;
				}
				Vector3 val2 = force1k / num * val;
				enemy.data.healthHandler.TakeForce(new Vector2(val2.x, 0.1f * val2.y), (ForceMode2D)1, true, true, 0f);
				((Vector2)(ref val3))..ctor(((Component)player).transform.position.x, ((Component)player).transform.position.y);
				if (magnitude <= 3f && PlayerManager.instance.CanSeePlayer(val3, enemy).canSee)
				{
					enemy.TakeDamage(damagePerTick * (float)CardAmount);
					player.data.healthHandler.Heal(healingPerTick);
				}
			}
		}

		public void Start()
		{
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			block = ((Component)player).GetComponent<Block>();
			if (damagePerTick == 0f)
			{
				damagePerTick = 1.048951f;
			}
			if (healingPerTick == 0f)
			{
				healingPerTick = 1.3986014f;
			}
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		public void OnDestroy()
		{
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			//IL_0000: 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)
			//IL_0005: Invalid comparison between Unknown and I4
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			if ((int)trigger == 0 || (int)trigger == 3 || (int)trigger == 2)
			{
				Activate((player.data.aimDirection.y > 0f) ? 20f : (-30f));
			}
		}
	}
	public class MegalithEffect : MonoBehaviour, ISingletonEffect
	{
		private int _cardAmount;

		public Player player;

		public Block block;

		private float counter;

		private const float DT = 0.1f;

		private IEnumerable<Player> visibleEnemies;

		private Player[] targets;

		private readonly List<Laser> lasers = new List<Laser>(2);

		public int CardAmount
		{
			get
			{
				return _cardAmount;
			}
			set
			{
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				_cardAmount = value;
				targets = (Player[])(object)new Player[2 * _cardAmount];
				lasers.SetListCount(2 * _cardAmount);
				foreach (Laser laser in lasers)
				{
					laser.Color = Color.red;
					laser.Width = 0.15f;
				}
			}
		}

		public void FixedUpdate()
		{
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			if (CardAmount <= 0)
			{
				return;
			}
			counter -= TimeHandler.deltaTime;
			Player[] array = visibleEnemies.OrderBy((Player p) => Vector3.Distance(((Component)p).transform.position, ((Component)player).transform.position)).ToArray();
			if (array.Length != 0)
			{
				for (int i = 0; i < targets.Length; i++)
				{
					targets[i] = array[i % array.Length];
				}
				for (int j = 0; j < targets.Length; j++)
				{
					Player target = targets[j];
					int num = targets.Count((Player x) => (Object)(object)x == (Object)(object)target);
					if (num > 0)
					{
						lasers[j].Width = 0.15f * (float)num * 1.5f;
					}
					lasers[j].Draw(((Component)player).transform.position, ((Component)target).transform.position);
				}
				float num2 = 0f;
				if (counter <= 0f)
				{
					counter = 0.1f;
					for (int k = 0; k < targets.Length; k++)
					{
						Player val = targets[k];
						num2 = 5f + 0.05f * val.data.maxHealth;
						((Damagable)val.data.healthHandler).TakeDamage(Vector2.up * num2 * 0.1f, Vector2.op_Implicit(((Component)val.data).transform.position), (GameObject)null, player, true, false);
					}
				}
			}
			else
			{
				lasers.ForEach(delegate(Laser l)
				{
					l.DrawHidden();
				});
			}
		}

		public void Start()
		{
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			block = ((Component)player).GetComponent<Block>();
			visibleEnemies = PlayerManager.instance.players.Where((Player p) => !p.data.dead && p.teamID != player.teamID && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)player.data).transform.position), p).canSee);
			PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied);
		}

		public void OnDestroy()
		{
			PlayerManager.instance.RemovePlayerDiedAction(PlayerDied);
		}

		private void PlayerDied(Player p, int idk)
		{
			if ((Object)(object)p == (Object)(object)player)
			{
				lasers.ForEach(delegate(Laser r)
				{
					r.DrawHidden();
				});
			}
		}
	}
	public class OverchargeEffect : CounterReversibleEffect, ISingletonEffect
	{
		private float counter;

		private bool modifiersActive;

		private readonly ObjectsToSpawn[] explosionToSpawn = (ObjectsToSpawn[])(object)new ObjectsToSpawn[1];

		public int CardAmount { get; set; }

		public void Activate()
		{
			counter += 2.5f * (float)CardAmount;
			SoundManager.Instance.Play(((ReversibleEffect)this).player.data.block.soundBlockStatusEffect, ((Component)((ReversibleEffect)this).block).transform);
		}

		public override CounterStatus UpdateCounter()
		{
			counter -= TimeHandler.deltaTime;
			if (!modifiersActive && counter > 0f)
			{
				return (CounterStatus)0;
			}
			if (counter <= 0f)
			{
				((CounterReversibleEffect)this).Reset();
				return (CounterStatus)2;
			}
			return (CounterStatus)1;
		}

		public override void UpdateEffects()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0071: 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_008e: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Expected O, but got Unknown
			((ReversibleEffect)this).gunStatModifier.attackSpeed_mult = 0.25f;
			((ReversibleEffect)this).gunStatModifier.bulletDamageMultiplier_mult = 2f;
			((ReversibleEffect)this).gunStatModifier.projectileSize_add = 2.5f;
			if (explosionToSpawn[0] == null)
			{
				var (addToProjectile, effect, _) = Supcom2.LoadExplosion("explosionOvercharge");
				explosionToSpawn[0] = new ObjectsToSpawn
				{
					AddToProjectile = addToProjectile,
					direction = (Direction)0,
					effect = effect,
					normalOffset = 0.1f,
					scaleFromDamage = 0.5f,
					scaleStackM = 0.7f,
					scaleStacks = true,
					spawnAsChild = false,
					spawnOn = (SpawnOn)0,
					stacks = 0,
					stickToAllTargets = false,
					stickToBigTargets = false,
					zeroZ = false
				};
			}
			((ReversibleEffect)this).gun.objectsToSpawn = ((ReversibleEffect)this).gun.objectsToSpawn.Concat(explosionToSpawn).ToArray();
		}

		public override void OnApply()
		{
			modifiersActive = true;
		}

		public override void OnRemove()
		{
			modifiersActive = false;
		}

		public override void Reset()
		{
			counter = 0f;
			modifiersActive = false;
			((ReversibleEffect)this).gun.objectsToSpawn = ((ReversibleEffect)this).gun.objectsToSpawn.Except(explosionToSpawn).ToArray();
		}

		public override void OnStart()
		{
			((ReversibleEffect)this).applyImmediately = false;
			((ReversibleEffect)this).SetLivesToEffect(int.MaxValue);
			Block block = ((ReversibleEffect)this).block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		public override void OnOnDestroy()
		{
			Block block = ((ReversibleEffect)this).block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			//IL_0000: 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)
			//IL_0005: Invalid comparison between Unknown and I4
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			if ((int)trigger == 0 || (int)trigger == 3 || (int)trigger == 2)
			{
				Activate();
			}
		}
	}
	public class QuantumSpongeEffect : MonoBehaviour, ISingletonEffect
	{
		public bool ChromeShielded;

		public Player player;

		public Block block;

		public int CardAmount { get; set; }

		private void Recharge()
		{
			if (ChromeShielded)
			{
				ChromeShielded = false;
			}
			else if (block.IsOnCD() && block.counter < 0.5f * block.Cooldown())
			{
				block.counter = 0.5f * block.Cooldown();
			}
		}

		public void Start()
		{
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			block = ((Component)player).GetComponent<Block>();
			CharacterStatModifiers stats = player.data.stats;
			stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Combine(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage));
		}

		public void OnDestroy()
		{
			CharacterStatModifiers stats = player.data.stats;
			stats.WasDealtDamageAction = (Action<Vector2, bool>)Delegate.Remove(stats.WasDealtDamageAction, new Action<Vector2, bool>(OnDamage));
		}

		private void OnDamage(Vector2 damage, bool selfDamage)
		{
			ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Supcom2.Instance, 1, (Action)Recharge);
		}
	}
	public class RadarJammerEffect : MonoBehaviour, ISingletonEffect
	{
		public Player player;

		public readonly List<Player> playersJammed = new List<Player>();

		private bool applied;

		public int CardAmount { get; set; }

		public void Update()
		{
			if (applied)
			{
				return;
			}
			foreach (Player item in PlayerManager.instance.players.Where((Player p) => p.teamID != player.teamID).Except(playersJammed))
			{
				((Component)item).gameObject.AddComponent<RadarJammed>().CardAmount = CardAmount;
				playersJammed.Add(item);
			}
			applied = true;
		}

		public void Start()
		{
			player = ((Component)this).GetComponent<Player>();
			PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied);
		}

		public void OnDestroy()
		{
			RemoveJammed();
			PlayerManager.instance.RemovePlayerDiedAction(PlayerDied);
		}

		public void RemoveJammed()
		{
			foreach (Player item in playersJammed)
			{
				Object.Destroy((Object)(object)((Component)item).gameObject.GetComponent<RadarJammed>());
			}
			playersJammed.Clear();
			applied = false;
		}

		private void PlayerDied(Player p, int idk)
		{
			if ((Object)(object)p == (Object)(object)player)
			{
				RemoveJammed();
			}
		}
	}
	public class RadarJammed : ReversibleEffect, ISingletonEffect
	{
		public int CardAmount { get; set; }

		public override void OnStart()
		{
			((ReversibleEffect)this).SetLivesToEffect(1);
			base.gunStatModifier.spread_add = RadarJammer.BULLET_SPREAD * (float)CardAmount;
			base.gun.AddAttackAction((Action)AttackAction);
		}

		public override void OnOnEnable()
		{
			((ReversibleEffect)this).ApplyModifiers();
		}

		public override void OnOnDestroy()
		{
			ExtensionMethods.InvokeMethod((object)base.gun, "RemoveAttackAction", new object[1]
			{
				new Action(AttackAction)
			});
		}

		public override void OnOnDisable()
		{
			((ReversibleEffect)this).ClearModifiers(true);
		}

		private void AttackAction()
		{
			((ReversibleEffect)this).ClearModifiers(true);
			GunStatModifier gunStatModifier = base.gunStatModifier;
			gunStatModifier.projectileSpeed_mult += (RNG.NextFloat() * 2f - 1f) * RadarJammer.BULLET_SPEED_RAND * (float)CardAmount;
			((ReversibleEffect)this).ApplyModifiers();
			ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Supcom2.Instance, 1, (Action)RemoveRandomizedBulletSpeed);
		}

		private void RemoveRandomizedBulletSpeed()
		{
			((ReversibleEffect)this).ClearModifiers(true);
			base.gunStatModifier.projectileSpeed_mult = 1f;
			((ReversibleEffect)this).ApplyModifiers();
		}
	}
	public class RogueNanitesEffect : MonoBehaviour, ISingletonEffect
	{
		public Player player;

		public Block block;

		public int CardAmount { get; set; }

		public void Start()
		{
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			block = ((Component)player).GetComponent<Block>();
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		public void OnDestroy()
		{
			Block obj = block;
			obj.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(obj.BlockAction, new Action<BlockTriggerType>(OnBlock));
		}

		private void OnBlock(BlockTriggerType trigger)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			if ((int)trigger == 0)
			{
				player.data.healthHandler.Heal(0.25f * player.data.maxHealth * (float)CardAmount);
				SoundManager.Instance.Play(player.data.block.soundBlockStatusEffect, ((Component)block).transform);
			}
		}
	}
	public class StackedCannonsEffect : MonoBehaviour, ISingletonEffect
	{
		public Player player;

		public Gun gun;

		public GunAmmo gunAmmo;

		public Block block;

		public int CardAmount { get; set; }

		public void AttackAction()
		{
			gun.numberOfProjectiles = gunAmmo.maxAmmo * CardAmount;
		}

		public void Start()
		{
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			gun = player.data.weaponHandler.gun;
			block = ((Component)player).GetComponent<Block>();
			gunAmmo = ((Component)gun).GetComponentInChildren<GunAmmo>();
			gun.AddAttackAction((Action)AttackAction);
		}

		public void OnDestroy()
		{
			ExtensionMethods.InvokeMethod((object)gun, "RemoveAttackAction", new object[1]
			{
				new Action(AttackAction)
			});
		}
	}
	public class VeterancyEffect : ReversibleEffect, ISingletonEffect
	{
		public static readonly float RankIconsHeight = 2.1f;

		public static readonly float RankIconsWidth = 1.8f;

		private int _rank;

		private static readonly float dx = RankIconsWidth / 5f;

		private readonly List<VeterancyRankIcon> rankIcons = new List<VeterancyRankIcon>();

		private static readonly LastSourceOfDamageList lastSourcesOfDamage = new LastSourceOfDamageList();

		public int CardAmount { get; set; }

		public int Rank
		{
			get
			{
				return _rank;
			}
			set
			{
				_rank = value;
				((ReversibleEffect)this).ClearModifiers(true);
				base.gunStatModifier.damage_mult = GetMult();
				base.characterDataModifier.maxHealth_mult = GetMult();
				((ReversibleEffect)this).ApplyModifiers();
				CharacterData data = base.player.data;
				data.health *= GetMult();
				rankIcons.SetListCount(_rank);
			}
		}

		public override void OnUpdate()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			int count = rankIcons.Count;
			Vector3 position = ((Component)base.player).transform.position;
			float num = position.x + RankIconsWidth / 2f - VeterancyRankIcon.Size;
			float num2 = position.y + RankIconsHeight - 2f * VeterancyRankIcon.Size;
			for (int i = 0; i < count; i++)
			{
				if (i % 5 == 0)
				{
					num -= RankIconsWidth;
					num2 += 2f * VeterancyRankIcon.Size;
				}
				num += dx;
				rankIcons[i].Draw(num, num2);
			}
		}

		public override void OnStart()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			((ReversibleEffect)this).SetLivesToEffect(int.MaxValue);
			CharacterStatModifiers.DealtDamage += new hook_DealtDamage(OnDealtDamage);
			PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied);
		}

		public override void OnOnDestroy()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			CharacterStatModifiers.DealtDamage -= new hook_DealtDamage(OnDealtDamage);
			PlayerManager.instance.RemovePlayerDiedAction(PlayerDied);
		}

		private void OnDealtDamage(orig_DealtDamage orig, CharacterStatModifiers self, Vector2 damage, bool selfDamage, Player damagedPlayer)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			CharacterData val = (CharacterData)ExtensionMethods.GetFieldValue((object)self, "data");
			if (!selfDamage && !((Object)(object)val == (Object)null))
			{
				lastSourcesOfDamage[damagedPlayer] = val.player;
				orig.Invoke(self, damage, selfDamage, damagedPlayer);
			}
		}

		private float GetMult()
		{
			return 1f + (float)Rank * 0.2f;
		}

		private void PlayerDied(Player p, int idk)
		{
			if ((Object)(object)p == (Object)(object)base.player)
			{
				rankIcons.ForEach(delegate(VeterancyRankIcon r)
				{
					r.DrawHidden();
				});
			}
			else if (p.teamID != base.player.teamID && Rank < 5 * CardAmount && (Object)(object)lastSourcesOfDamage[p] == (Object)(object)base.player)
			{
				Rank++;
				lastSourcesOfDamage[p] = null;
			}
		}
	}
	public class VeterancyRankIcon
	{
		public static Color Color = Color.yellow;

		public static Material Material = new Material(Shader.Find("UI/Default"));

		public static float Size = 0.2f;

		public static float Width = 0.15f;

		public static float Z = -5f;

		private readonly LineRenderer lineL;

		private readonly Vector3[] cordsL = (Vector3[])(object)new Vector3[2];

		private readonly LineRenderer lineR;

		private readonly Vector3[] cordsR = (Vector3[])(object)new Vector3[2];

		private static int id = 0;

		public VeterancyRankIcon()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			lineL = new GameObject().AddComponent<LineRenderer>();
			((Object)lineL).name = $"VeterancyIconLine_{id}L";
			lineL.startWidth = Width;
			lineL.endWidth = Width;
			lineL.startColor = Color.white;
			lineL.endColor = Color.white;
			((Renderer)lineL).material = Material;
			((Renderer)lineL).material.color = Color;
			lineL.useWorldSpace = true;
			lineR = new GameObject().AddComponent<LineRenderer>();
			((Object)lineR).name = $"VeterancyIconLine_{id++}R";
			lineR.startWidth = Width;
			lineR.endWidth = Width;
			lineR.startColor = Color.white;
			lineR.endColor = Color.white;
			((Renderer)lineR).material = Material;
			((Renderer)lineR).material.color = Color;
			lineR.useWorldSpace = true;
			cordsL[0].z = Z;
			cordsL[1].z = Z;
			cordsR[0].z = Z;
			cordsR[1].z = Z;
		}

		~VeterancyRankIcon()
		{
			Object.Destroy((Object)(object)lineL);
			Object.Destroy((Object)(object)lineR);
		}

		public void Draw(float x, float y)
		{
			cordsL[0].x = x - Size;
			cordsL[0].y = y + Size;
			cordsL[1].x = x;
			cordsL[1].y = y;
			cordsR[0].x = x + Size;
			cordsR[0].y = y + Size;
			cordsR[1].x = x;
			cordsR[1].y = y;
			lineL.SetPositions(cordsL);
			lineR.SetPositions(cordsR);
		}

		public void DrawHidden()
		{
			cordsL[0].x = 100f;
			cordsL[0].y = 100f;
			cordsL[1].x = 100f;
			cordsL[1].y = 100f;
			cordsR[0].x = 100f;
			cordsR[0].y = 100f;
			cordsR[1].x = 100f;
			cordsR[1].y = 100f;
			lineL.SetPositions(cordsL);
			lineR.SetPositions(cordsR);
		}
	}
	public class LastSourceOfDamageList : Dictionary<Player, Player?>
	{
		public new Player? this[Player player]
		{
			get
			{
				if (!ContainsKey(player))
				{
					return null;
				}
				return base[player];
			}
			set
			{
				if (ContainsKey(player))
				{
					base[player] = value;
				}
				else
				{
					Add(player, value);
				}
			}
		}
	}
	public class WilfindjaEffect : MonoBehaviour, ISingletonEffect
	{
		private class Drone
		{
			public double angle;

			private static readonly double a = Math.PI * 2.0 / 3.0;

			public void Draw(float x, float y, List<Laser> lasers, double angle = 0.0)
			{
				float num = x + 0.3f * (float)Math.Cos((double)(lasers.Count - 1) * a - angle * 3.0);
				float num2 = y + 0.3f * (float)Math.Sin((double)(lasers.Count - 1) * a - angle * 3.0);
				for (int i = 0; i < lasers.Count; i++)
				{
					float x2 = num;
					float y2 = num2;
					double d = (double)i * a - angle * 3.0;
					num = x + 0.3f * (float)Math.Cos(d);
					num2 = y + 0.3f * (float)Math.Sin(d);
					lasers[i].Draw(x2, y2, num, num2);
				}
			}
		}

		private int _cardAmount;

		public Player player;

		public Gun gun;

		private float counter;

		private const float DT = 0.1f;

		private float spin;

		private readonly List<Drone> drones = new List<Drone>(12);

		private readonly List<Laser> lasers = new List<Laser>(36);

		public int CardAmount
		{
			get
			{
				return _cardAmount;
			}
			set
			{
				//IL_007e: Unknown result type (might be due to invalid IL or missing references)
				_cardAmount = value;
				drones.SetListCount(12 * _cardAmount);
				double num = Math.PI / 6.0;
				for (int i = 0; i < drones.Count; i++)
				{
					drones[i].angle = (double)i * num;
				}
				lasers.SetListCount(3 * drones.Count);
				foreach (Laser laser in lasers)
				{
					laser.Color = Color.cyan;
					laser.Width = 0.075f;
				}
			}
		}

		public void FixedUpdate()
		{
			//IL_00b2: 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_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			if (CardAmount <= 0)
			{
				return;
			}
			counter -= TimeHandler.deltaTime;
			spin += TimeHandler.deltaTime * 60f;
			if (spin > 60f)
			{
				spin -= 60f;
			}
			double num = (double)spin * 0.10471975511965978;
			for (int i = 0; i < drones.Count; i++)
			{
				int num2 = i / 12;
				float layerAmplitude = GetLayerAmplitude(num2);
				double num3 = drones[i].angle + num * ((double)num2 * 0.25 + 1.0);
				float x = ((Component)player).transform.position.x + layerAmplitude * (float)Math.Cos(num3);
				float y = ((Component)player).transform.position.y + layerAmplitude * (float)Math.Sin(num3);
				drones[i].Draw(x, y, lasers.GetRange(i * 3, 3), num3);
			}
			if (!(counter <= 0f))
			{
				return;
			}
			counter = 0.1f;
			foreach (Player item in PlayerManager.instance.players.Where((Player p) => !p.data.dead && p.teamID != player.teamID))
			{
				float num4 = Vector3.Distance(((Component)player).transform.position, ((Component)item).transform.position);
				for (int j = 0; j < CardAmount; j++)
				{
					float layerAmplitude2 = GetLayerAmplitude(j);
					float num5 = layerAmplitude2 - 2.25f;
					float num6 = layerAmplitude2 + 2.25f;
					if (num4 > num5 && num4 < num6)
					{
						float num7 = 110f * gun.damage;
						((Damagable)item.data.healthHandler).TakeDamage(Vector2.up * num7 * 0.1f, Vector2.op_Implicit(((Component)item.data).transform.position), (GameObject)null, player, true, false);
					}
				}
			}
		}

		public void Start()
		{
			player = ((Component)this).gameObject.GetComponentInParent<Player>();
			gun = player.data.weaponHandler.gun;
			PlayerManager.instance.AddPlayerDiedAction((Action<Player, int>)PlayerDied);
		}

		public void OnDestroy()
		{
			PlayerManager.instance.RemovePlayerDiedAction(PlayerDied);
		}

		private void PlayerDied(Player p, int idk)
		{
			if (!((Object)(object)p == (Object)(object)player))
			{
				return;
			}
			foreach (Laser laser in lasers)
			{
				laser.DrawHidden();
			}
		}

		private float GetLayerAmplitude(int layer)
		{
			return 7f * ((float)layer * 0.5f + 1f);
		}
	}
}
namespace Supcom2Cards.Cards
{
	internal class Afterburn : CustomCard
	{
		public const float AB_SECONDS = 2f;

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			block.cdAdd += 0.5f;
			player.IncrementCardEffect<AfterburnEffect>();
		}

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

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

		protected override string GetDescription()
		{
			return $"Blocking doubles Movement Speed for {2f} (extra) seconds";
		}

		protected override GameObject GetCardArt()
		{
			Supcom2.CardArt.TryGetValue("Afterburn", out GameObject value);
			return value;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Movement speed if active",
					amount = "+100%",
					simepleAmount = (SimpleAmount)3
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Block cooldown",
					amount = "+0.5s",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)2;
		}

		public override string GetModName()
		{
			return "SC2";
		}
	}
	internal class BombBouncer : CustomCard
	{
		public static readonly Color COLOR_CHARGED = Color.red;

		public static readonly Color COLOR_UNCHARGED = Color.yellow;

		public const float CHARGE_MULT = 1.5f;

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			//IL_0052: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			data.maxHealth *= 1.3f;
			block.cdAdd += 0.5f;
			BombBouncerEffect bombBouncerEffect = player.IncrementCardEffect<BombBouncerEffect>();
			if (bombBouncerEffect.CardAmount == 1)
			{
				(GameObject AddToProjectile, GameObject effect, Explosion explosion) tuple = Supcom2.LoadExplosion("explosionBombBouncer");
				GameObject item = tuple.AddToProjectile;
				GameObject item2 = tuple.effect;
				bombBouncerEffect.Explosion = new ObjectsToSpawn
				{
					AddToProjectile = item,
					direction = (Direction)0,
					effect = item2,
					normalOffset = 0.1f,
					scaleFromDamage = 0.5f,
					scaleStackM = 0.7f,
					scaleStacks = true,
					spawnAsChild = false,
					spawnOn = (SpawnOn)0,
					stacks = 0,
					stickToAllTargets = false,
					stickToBigTargets = false,
					zeroZ = false
				};
				ExtensionMethods.GetOrAddComponent<SpawnedAttack>(item2, false).spawner = player;
			}
		}

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

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

		protected override string GetDescription()
		{
			return "Damage you take will be released\nin a big explosion next block\n";
		}

		protected override GameObject GetCardArt()
		{
			Supcom2.CardArt.TryGetValue("BombBouncer", out GameObject value);
			return value;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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_0041: Expected O, but got Unknown
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Max charge",
					amount = $"+{150f}%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "HP",
					amount = "+30%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Block cooldown",
					amount = "+0.5s",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)0;
		}

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			gun.damage *= 0.85f;
			player.IncrementCardEffect<BuhbledowEffect>().Owner = player;
		}

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

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

		protected override string GetDescription()
		{
			return "Dealing damage to somebody halfs the current recharge of their block meter unless full";
		}

		protected override GameObject GetCardArt()
		{
			Supcom2.CardArt.TryGetValue("Buhbledow", out GameObject value);
			return value;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "DMG",
					amount = "-15%",
					simepleAmount = (SimpleAmount)5
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)5;
		}

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			data.maxHealth *= 1.3f;
			block.cdAdd += 1.75f;
			player.IncrementCardEffect<ChromeShieldEffect>();
		}

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

		protected override string GetTitle()
		{
			return "Chrome Shield";
		}

		protected override string GetDescription()
		{
			return "Automatically blocks before taking damage if block is ready";
		}

		protected override GameObject GetCardArt()
		{
			Supcom2.CardArt.TryGetValue("ChromeShield", out GameObject value);
			return value;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "HP",
					amount = "+30%",
					simepleAmount = (SimpleAmount)6
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Block cooldown",
					amount = "+1.75s",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)5;
		}

		public override string GetModName()
		{
			return "SC2";
		}
	}
	internal class ClusterBomb : CustomCard
	{
		public static readonly int EXPLOSION_AMOUNT = 7;

		public static readonly float EXPLOSION_DMG_MULT = 16.5f;

		public static readonly int EXPLOSION_SPREAD = 7;

		public static readonly int FRAMES_MIN = 1;

		public static readonly int FRAMES_MAX = 25;

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			gun.damage *= 1.25f;
			gun.attackSpeed *= 1.75f;
			ClusterBombEffect clusterBombEffect = player.IncrementCardEffect<ClusterBombEffect>();
			if (clusterBombEffect.CardAmount == 1)
			{
				(GameObject AddToProjectile, GameObject effect, Explosion explosion) tuple = Supcom2.LoadExplosion("explosionClusterBomb");
				GameObject item = tuple.AddToProjectile;
				GameObject item2 = tuple.effect;
				Explosion obj = (clusterBombEffect.Explosion = tuple.explosion);
				obj.force *= 0.1f;
				clusterBombEffect.ExplosionToSpawn = new ObjectsToSpawn
				{
					AddToProjectile = item,
					direction = (Direction)0,
					effect = item2,
					normalOffset = 0.1f,
					scaleFromDamage = 0.5f,
					scaleStackM = 0.7f,
					scaleStacks = true,
					spawnAsChild = false,
					spawnOn = (SpawnOn)0,
					stacks = 0,
					stickToAllTargets = false,
					stickToBigTargets = false,
					zeroZ = false
				};
				ExtensionMethods.GetOrAddComponent<SpawnedAttack>(item2, false).spawner = player;
				clusterBombEffect.gun = gun;
				ClusterBombEffect.sound = gun.player.data.playerSounds.soundCharacterLand;
			}
		}

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

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

		protected override string GetDescription()
		{
			return $"Bullets create {EXPLOSION_AMOUNT} (extra) tiny explosions after impact";
		}

		protected override GameObject GetCardArt()
		{
			Supcom2.CardArt.TryGetValue("ClusterBomb", out GameObject value);
			return value;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "DMG",
					amount = "+25%",
					simepleAmount = (SimpleAmount)6
				},
				new CardInfoStat
				{
					positive = false,
					stat = "ATKSPD",
					amount = "-75%",
					simepleAmount = (SimpleAmount)6
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)2;
		}

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			data.maxHealth *= 3.5f;
			block.cdAdd += 2.5f;
			characterStats.movementSpeed *= 0.75f;
			characterStats.jump *= 0.9f;
		}

		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 "Colossus";
		}

		protected override string GetDescription()
		{
			return null;
		}

		protected override GameObject GetCardArt()
		{
			Supcom2.CardArt.TryGetValue("Colossus", out GameObject value);
			return value;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)2;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[4]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "HP",
					amount = "+250%",
					simepleAmount = (SimpleAmount)4
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Block cooldown",
					amount = "+2.5s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Movement speed",
					amount = "-25%",
					simepleAmount = (SimpleAmount)7
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Jump height",
					amount = "-10%",
					simepleAmount = (SimpleAmount)6
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)5;
		}

		public override string GetModName()
		{
			return "SC2";
		}
	}
	internal class Crahdow : CustomCard
	{
		public static float DMG_BOOST = 2f;

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			data.maxHealth *= 0.9f;
			player.IncrementCardEffect<CrahdowEffect>();
		}

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

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

		protected override string GetDescription()
		{
			return "Deal extra DMG to\nplayers in mid-air";
		}

		protected override GameObject GetCardArt()
		{
			Supcom2.CardArt.TryGetValue("Crahdow", out GameObject value);
			return value;
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			/