Decompiled source of GearUpCards v0.4.2

GearUpCards.dll

Decompiled 8 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 CardChoiceSpawnUniqueCardPatch.CustomCategories;
using GearUpCards.Cards;
using GearUpCards.Extensions;
using GearUpCards.MonoBehaviours;
using GearUpCards.Utils;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.Extensions;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.Utils;
using Photon.Pun;
using RarityLib.Utils;
using Sonigon;
using SoundImplementation;
using TMPro;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Utils;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyVersion("0.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class CardHolder : MonoBehaviour
{
	public List<GameObject> Cards;

	public List<GameObject> HiddenCards;

	internal void RegisterCards()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: 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)
		Enumerator<GameObject> enumerator = Cards.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				GameObject current = enumerator.Current;
				CustomCard component = current.GetComponent<CustomCard>();
				if (component != null)
				{
					component.BuildUnityCard((Action<CardInfo>)null);
				}
				else
				{
					CustomCard.RegisterUnityCard(current, "GearUP", current.GetComponent<CardInfo>().cardName, true, (Action<CardInfo>)null);
				}
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
		enumerator = HiddenCards.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				GameObject current2 = enumerator.Current;
				CustomCard component2 = current2.GetComponent<CustomCard>();
				if (component2 != null)
				{
					component2.BuildUnityCard((Action<CardInfo>)delegate(CardInfo cardInfo)
					{
						Cards.instance.AddHiddenCard(cardInfo);
					});
				}
				else
				{
					CustomCard.RegisterUnityCard(current2, "GearUP", current2.GetComponent<CardInfo>().cardName, false, (Action<CardInfo>)null);
					Cards.instance.AddHiddenCard(current2.GetComponent<CardInfo>());
				}
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
	}
}
public class FixSoundEffect : MonoBehaviour
{
	private Gun gun;

	private void Awake()
	{
		gun = ((Component)this).GetComponent<Gun>();
		AudioMixerGroup audioGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
		SetAudioMixerGroup(gun.soundShotModifier.single, audioGroup);
		SetAudioMixerGroup(gun.soundShotModifier.singleAutoLoop, audioGroup);
		SetAudioMixerGroup(gun.soundShotModifier.singleAutoTail, audioGroup);
		SetAudioMixerGroup(gun.soundShotModifier.shotgun, audioGroup);
		SetAudioMixerGroup(gun.soundShotModifier.shotgunAutoLoop, audioGroup);
		SetAudioMixerGroup(gun.soundShotModifier.shotgunAutoTail, audioGroup);
		SetAudioMixerGroup(gun.soundImpactModifier.impactCharacter, audioGroup);
		SetAudioMixerGroup(gun.soundImpactModifier.impactEnvironment, audioGroup);
	}

	private void SetAudioMixerGroup(SoundEvent soundEvent, AudioMixerGroup audioGroup)
	{
		if (!((Object)(object)soundEvent == (Object)null))
		{
			soundEvent.variables.audioMixerGroup = audioGroup;
		}
	}
}
namespace GearUpCards
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.pudassassin.rounds.GearUpCards", "GearUpCards", "0.4.2.0")]
	[BepInProcess("Rounds.exe")]
	public class GearUpCards : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c : Object
		{
			public static readonly <>c <>9 = new <>c();

			public static Action <>9__12_0;

			public static Action <>9__12_1;

			public static Action<Card> <>9__14_0;

			public static Action<Card> <>9__14_1;

			internal void <Start>b__12_0()
			{
				if ((Object)(object)CardUtils.GetCardInfo("Size Difference") != (Object)null)
				{
					CardInfo cardInfo = CardUtils.GetCardInfo("Size Difference");
					CardUtils.MakeExclusive("Size Difference", "Size Normalizer");
					List<CardCategory> val = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo.categories);
					val.Add(CardUtils.GearCategory.typeSizeMod);
					cardInfo.categories = val.ToArray();
				}
				if ((Object)(object)CardUtils.GetCardInfo("Size Matters") != (Object)null)
				{
					CardInfo cardInfo2 = CardUtils.GetCardInfo("Size Matters");
					CardUtils.MakeExclusive("Size Matters", "Size Normalizer");
					List<CardCategory> val2 = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo2.categories);
					val2.Add(CardUtils.GearCategory.typeSizeMod);
					cardInfo2.categories = val2.ToArray();
				}
				CardUtils.MakeExclusive("Gatling Gun", "Flak Cannon");
				if ((Object)(object)CardUtils.GetCardInfo("Plasma Rifle") != (Object)null)
				{
					CardInfo cardInfo3 = CardUtils.GetCardInfo("Plasma Rifle");
					CardUtils.MakeExclusive("Plasma Rifle", "Flak Cannon");
					List<CardCategory> val3 = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo3.categories);
					val3.Add(CardUtils.GearCategory.typeGunMod);
					cardInfo3.categories = val3.ToArray();
				}
				if ((Object)(object)CardUtils.GetCardInfo("Plasma Shotgun") != (Object)null)
				{
					CardInfo cardInfo4 = CardUtils.GetCardInfo("Plasma Shotgun");
					CardUtils.MakeExclusive("Plasma Shotgun", "Flak Cannon");
					List<CardCategory> val4 = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo4.categories);
					val4.Add(CardUtils.GearCategory.typeGunMod);
					cardInfo4.categories = val4.ToArray();
				}
				CardUtils.MakeExclusive("Fragmentation", "Flak Cannon");
				CardUtils.MakeExclusive("Fireworks", "Flak Cannon");
				CardUtils.MakeExclusive("Rolling Thunder", "Flak Cannon");
				CardUtils.MakeExclusive("Splitting Rounds", "Flak Cannon");
				CardUtils.MakeExclusive("Hive", "Flak Cannon");
				if (Object.op_Implicit((Object)(object)CardUtils.GetCardInfo("Shock Blast")))
				{
					CardInfo cardInfo5 = CardUtils.GetCardInfo("Shock Blast");
					CardUtils.MakeExclusive("Shock Blast", "Flak Cannon");
					CardUtils.MakeExclusive("Shock Blast", "Arc of Bullets");
					CardUtils.MakeExclusive("Shock Blast", "Parallel Bullets");
					List<CardCategory> val5 = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo5.categories);
					val5.Add(CardUtils.GearCategory.typeGunMod);
					val5.Add(CardUtils.GearCategory.typeUniqueGunSpread);
					cardInfo5.categories = val5.ToArray();
				}
			}

			internal void <Start>b__12_1()
			{
				//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)
				IEnumerator<Rarity> enumerator = RarityUtils.Rarities.Values.GetEnumerator();
				try
				{
					while (((IEnumerator)enumerator).MoveNext())
					{
						Rarity current = enumerator.Current;
						CardUtils.rarityCategories.Add(current, CustomCardCategories.instance.CardCategory(String.Concat("__Rarity-", current.name)));
					}
				}
				finally
				{
					if (enumerator != null)
					{
						((IDisposable)enumerator).Dispose();
					}
				}
				Enumerator<string> enumerator2 = CardManager.categories.GetEnumerator();
				try
				{
					while (enumerator2.MoveNext())
					{
						string current2 = enumerator2.Current;
						CardUtils.packCategories.Add(current2, CustomCardCategories.instance.CardCategory(String.Concat("__Pack-", current2)));
					}
				}
				finally
				{
					((IDisposable)enumerator2).Dispose();
				}
			}

			internal void <GameStart>b__14_0(Card card)
			{
				//IL_000a: 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)
				Enumerator<Rarity, CardCategory> enumerator = CardUtils.rarityCategories.Values.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						CardCategory current = enumerator.Current;
						List<CardCategory> val = new List<CardCategory>((IEnumerable<CardCategory>)(object)card.cardInfo.categories);
						if (val.Contains(current))
						{
							val.Remove(current);
							CardCategory[] categories = val.ToArray();
							card.cardInfo.categories = categories;
							break;
						}
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
			}

			internal void <GameStart>b__14_1(Card card)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				Rarity rarityData = RarityUtils.GetRarityData(card.cardInfo.rarity);
				CardCategory val = CardUtils.rarityCategories[rarityData];
				CardCategory[] categories = CollectionExtensions.AddToArray<CardCategory>(card.cardInfo.categories, val);
				card.cardInfo.categories = categories;
			}
		}

		public const string ModId = "com.pudassassin.rounds.GearUpCards";

		public const string ModName = "GearUpCards";

		public const string Version = "0.4.2.0";

		public const string ModInitials = "GearUP";

		public static bool isCardPickingPhase = false;

		public static bool isCardExtraDrawPhase = false;

		private static int lastPickerID = -1;

		public static AssetBundle VFXBundle;

		public static AssetBundle ATPBundle;

		public static AssetBundle CardArtBundle;

		public static AssetBundle CardAssets;

		private void Awake()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			Miscs.Log("[GearUp] Harmony Patching");
			new Harmony("com.pudassassin.rounds.GearUpCards").PatchAll();
			Miscs.Log("[GearUp] Harmony Patched");
			ATPBundle = AssetUtils.LoadAssetBundleFromResources("gearup_game_effect", typeof(GearUpCards).Assembly);
			ATPBundle.LoadAllAssets();
			Miscs.Log("[GearUp] Loaded ATP stuffs");
			VFXBundle = AssetUtils.LoadAssetBundleFromResources("gearup_asset", typeof(GearUpCards).Assembly);
			VFXBundle.LoadAllAssets();
			CardArtBundle = AssetUtils.LoadAssetBundleFromResources("gearup_cardarts", typeof(GearUpCards).Assembly);
			CardArtBundle.LoadAllAssets();
		}

		private void Start()
		{
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Expected O, but got Unknown
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Expected O, but got Unknown
			CardAssets = AssetUtils.LoadAssetBundleFromResources("gearup_cardprefab", typeof(GearUpCards).Assembly);
			CardAssets.LoadAllAssets();
			CardAssets.LoadAsset<GameObject>("CardHolderObject").GetComponent<CardHolder>().RegisterCards();
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)GameStart);
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd);
			GameModeManager.AddHook("PickStart", (Func<IGameModeHandler, IEnumerator>)OnPickStart);
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickEnd);
			GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)PointStart);
			object obj = <>c.<>9__12_0;
			if (obj == null)
			{
				Action val = delegate
				{
					if ((Object)(object)CardUtils.GetCardInfo("Size Difference") != (Object)null)
					{
						CardInfo cardInfo = CardUtils.GetCardInfo("Size Difference");
						CardUtils.MakeExclusive("Size Difference", "Size Normalizer");
						List<CardCategory> val3 = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo.categories);
						val3.Add(CardUtils.GearCategory.typeSizeMod);
						cardInfo.categories = val3.ToArray();
					}
					if ((Object)(object)CardUtils.GetCardInfo("Size Matters") != (Object)null)
					{
						CardInfo cardInfo2 = CardUtils.GetCardInfo("Size Matters");
						CardUtils.MakeExclusive("Size Matters", "Size Normalizer");
						List<CardCategory> val4 = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo2.categories);
						val4.Add(CardUtils.GearCategory.typeSizeMod);
						cardInfo2.categories = val4.ToArray();
					}
					CardUtils.MakeExclusive("Gatling Gun", "Flak Cannon");
					if ((Object)(object)CardUtils.GetCardInfo("Plasma Rifle") != (Object)null)
					{
						CardInfo cardInfo3 = CardUtils.GetCardInfo("Plasma Rifle");
						CardUtils.MakeExclusive("Plasma Rifle", "Flak Cannon");
						List<CardCategory> val5 = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo3.categories);
						val5.Add(CardUtils.GearCategory.typeGunMod);
						cardInfo3.categories = val5.ToArray();
					}
					if ((Object)(object)CardUtils.GetCardInfo("Plasma Shotgun") != (Object)null)
					{
						CardInfo cardInfo4 = CardUtils.GetCardInfo("Plasma Shotgun");
						CardUtils.MakeExclusive("Plasma Shotgun", "Flak Cannon");
						List<CardCategory> val6 = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo4.categories);
						val6.Add(CardUtils.GearCategory.typeGunMod);
						cardInfo4.categories = val6.ToArray();
					}
					CardUtils.MakeExclusive("Fragmentation", "Flak Cannon");
					CardUtils.MakeExclusive("Fireworks", "Flak Cannon");
					CardUtils.MakeExclusive("Rolling Thunder", "Flak Cannon");
					CardUtils.MakeExclusive("Splitting Rounds", "Flak Cannon");
					CardUtils.MakeExclusive("Hive", "Flak Cannon");
					if (Object.op_Implicit((Object)(object)CardUtils.GetCardInfo("Shock Blast")))
					{
						CardInfo cardInfo5 = CardUtils.GetCardInfo("Shock Blast");
						CardUtils.MakeExclusive("Shock Blast", "Flak Cannon");
						CardUtils.MakeExclusive("Shock Blast", "Arc of Bullets");
						CardUtils.MakeExclusive("Shock Blast", "Parallel Bullets");
						List<CardCategory> val7 = Enumerable.ToList<CardCategory>((IEnumerable<CardCategory>)(object)cardInfo5.categories);
						val7.Add(CardUtils.GearCategory.typeGunMod);
						val7.Add(CardUtils.GearCategory.typeUniqueGunSpread);
						cardInfo5.categories = val7.ToArray();
					}
				};
				<>c.<>9__12_0 = val;
				obj = (object)val;
			}
			ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)this, 10, (Action)obj);
			object obj2 = <>c.<>9__12_1;
			if (obj2 == null)
			{
				Action val2 = delegate
				{
					//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)
					IEnumerator<Rarity> enumerator = RarityUtils.Rarities.Values.GetEnumerator();
					try
					{
						while (((IEnumerator)enumerator).MoveNext())
						{
							Rarity current = enumerator.Current;
							CardUtils.rarityCategories.Add(current, CustomCardCategories.instance.CardCategory(String.Concat("__Rarity-", current.name)));
						}
					}
					finally
					{
						if (enumerator != null)
						{
							((IDisposable)enumerator).Dispose();
						}
					}
					Enumerator<string> enumerator2 = CardManager.categories.GetEnumerator();
					try
					{
						while (enumerator2.MoveNext())
						{
							string current2 = enumerator2.Current;
							CardUtils.packCategories.Add(current2, CustomCardCategories.instance.CardCategory(String.Concat("__Pack-", current2)));
						}
					}
					finally
					{
						((IDisposable)enumerator2).Dispose();
					}
				};
				<>c.<>9__12_1 = val2;
				obj2 = (object)val2;
			}
			ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)this, 65, (Action)obj2);
		}

		private void Update()
		{
			if (isCardPickingPhase && lastPickerID != CardChoice.instance.pickrID)
			{
				if (CardChoice.instance.pickrID >= 0)
				{
					CardUtils.ModifyPerPlayerCardRarity(CardChoice.instance.pickrID);
				}
				lastPickerID = CardChoice.instance.pickrID;
			}
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator GameStart(IGameModeHandler gm)
		{
			Enumerator<Player> enumerator = PlayerManager.instance.players.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Player current = enumerator.Current;
					if (!CharacterStatModifiersExtension.GetAdditionalData(current.data.stats).blacklistedCategories.Contains(CardUtils.GearCategory.tagSpellOnlyAugment))
					{
						CharacterStatModifiersExtension.GetAdditionalData(current.data.stats).blacklistedCategories.Add(CardUtils.GearCategory.tagSpellOnlyAugment);
					}
					if (CharacterStatModifiersExtension.GetAdditionalData(current.data.stats).blacklistedCategories.Contains(CardUtils.GearCategory.typeUniqueGunSpread))
					{
						CharacterStatModifiersExtension.GetAdditionalData(current.data.stats).blacklistedCategories.Remove(CardUtils.GearCategory.typeUniqueGunSpread);
					}
					if (CharacterStatModifiersExtension.GetAdditionalData(current.data.stats).blacklistedCategories.Contains(CardUtils.GearCategory.typeSizeMod))
					{
						CharacterStatModifiersExtension.GetAdditionalData(current.data.stats).blacklistedCategories.Remove(CardUtils.GearCategory.typeSizeMod);
					}
					if (CharacterStatModifiersExtension.GetAdditionalData(current.data.stats).blacklistedCategories.Contains(CardUtils.GearCategory.typeUniqueMagick))
					{
						CharacterStatModifiersExtension.GetAdditionalData(current.data.stats).blacklistedCategories.Remove(CardUtils.GearCategory.typeUniqueMagick);
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			CardUtils.raritySnapshot = new Dictionary<string, float>();
			if (CardUtils.cardCategoryHasRarity)
			{
				Enumerable.ToList<Card>((IEnumerable<Card>)(object)CardManager.cards.Values).ForEach((Action<Card>)delegate(Card card)
				{
					//IL_000a: 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)
					Enumerator<Rarity, CardCategory> enumerator2 = CardUtils.rarityCategories.Values.GetEnumerator();
					try
					{
						while (enumerator2.MoveNext())
						{
							CardCategory current2 = enumerator2.Current;
							List<CardCategory> val2 = new List<CardCategory>((IEnumerable<CardCategory>)(object)card.cardInfo.categories);
							if (val2.Contains(current2))
							{
								val2.Remove(current2);
								CardCategory[] categories2 = val2.ToArray();
								card.cardInfo.categories = categories2;
								break;
							}
						}
					}
					finally
					{
						((IDisposable)enumerator2).Dispose();
					}
				});
				CardUtils.cardCategoryHasRarity = false;
			}
			Enumerable.ToList<Card>((IEnumerable<Card>)(object)CardManager.cards.Values).ForEach((Action<Card>)delegate(Card card)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				Rarity rarityData = RarityUtils.GetRarityData(card.cardInfo.rarity);
				CardCategory val = CardUtils.rarityCategories[rarityData];
				CardCategory[] categories = CollectionExtensions.AddToArray<CardCategory>(card.cardInfo.categories, val);
				card.cardInfo.categories = categories;
			});
			CardUtils.cardCategoryHasRarity = true;
			enumerator = PlayerManager.instance.players.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					((Component)enumerator.Current).gameObject.AddComponent<CardDrawTracker>();
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			yield break;
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator OnPickStart(IGameModeHandler gm)
		{
			Miscs.Log("[GearUpCard] OnPickStart()");
			isCardPickingPhase = true;
			yield break;
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator OnPlayerPickEnd(IGameModeHandler gm)
		{
			Miscs.Log("[GearUpCard] OnPickEnd()");
			CardUtils.RarityDelta.UndoAll();
			yield return new WaitForSecondsRealtime(0.1f);
			if (isCardExtraDrawPhase || CardDrawTracker.extraDrawPlayerQueue.Count <= 0)
			{
				yield break;
			}
			isCardExtraDrawPhase = true;
			Miscs.Log("[GearUpCard] Extra draw locked in");
			for (int i = 0; i < CardDrawTracker.extraDrawPlayerQueue.Count; i++)
			{
				string text = ((Int32)(ref i)).ToString();
				Player obj = CardDrawTracker.extraDrawPlayerQueue[i];
				Miscs.Log(String.Concat("Checking ", text, " | ", (obj != null) ? ((Object)obj).ToString() : null));
				CardDrawTracker component = ((Component)CardDrawTracker.extraDrawPlayerQueue[i]).gameObject.GetComponent<CardDrawTracker>();
				if ((Object)(object)component != (Object)null)
				{
					yield return component.ResolveExtraDraws();
					yield return new WaitForSecondsRealtime(0.1f);
				}
				string text2 = ((Int32)(ref i)).ToString();
				Player obj2 = CardDrawTracker.extraDrawPlayerQueue[i];
				Miscs.Log(String.Concat("Checked! ", text2, " | ", (obj2 != null) ? ((Object)obj2).ToString() : null));
			}
			CardDrawTracker.extraDrawPlayerQueue.Clear();
			isCardExtraDrawPhase = false;
			Miscs.Log("[GearUpCard] Extra draw unlocked");
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator PointEnd(IGameModeHandler gm)
		{
			MapUtils.ClearMapObjectsList();
			yield break;
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator PointStart(IGameModeHandler gm)
		{
			isCardPickingPhase = false;
			yield break;
		}
	}
}
namespace GearUpCards.Utils
{
	public class CardUtils : Object
	{
		public static class GearCategory : Object
		{
			public static CardCategory noType = CustomCardCategories.instance.CardCategory("GearUp_Unspecified");

			public static CardCategory typeGunMod = CustomCardCategories.instance.CardCategory("GearUp_Gun-Mod");

			public static CardCategory typeBlockMod = CustomCardCategories.instance.CardCategory("GearUp_Block-Mod");

			public static CardCategory typeSizeMod = CustomCardCategories.instance.CardCategory("GearUp_Size-Mod");

			public static CardCategory typeUniqueMagick = CustomCardCategories.instance.CardCategory("GearUp_Unique-Magick");

			public static CardCategory typeUniqueGunSpread = CustomCardCategories.instance.CardCategory("GearUp_Unique-Gun-Spread");

			public static CardCategory typeUniqueCAD = CustomCardCategories.instance.CardCategory("GearUp_Unique-CAD");

			public static CardCategory typeParts = CustomCardCategories.instance.CardCategory("GearUp_Parts");

			public static CardCategory typeCharm = CustomCardCategories.instance.CardCategory("GearUp_Charm");

			public static CardCategory typeGear = CustomCardCategories.instance.CardCategory("GearUp_Gear");

			public static CardCategory typeGlyph = CustomCardCategories.instance.CardCategory("GearUp_Glyph");

			public static CardCategory typeSpell = CustomCardCategories.instance.CardCategory("GearUp_Spell");

			public static CardCategory typeCadModule = CustomCardCategories.instance.CardCategory("GearUp_CAD-Module");

			public static CardCategory typeBoosterPack = CustomCardCategories.instance.CardCategory("GearUp_Booster-Pack");

			public static CardCategory typeCardShuffle = CustomCardCategories.instance.CardCategory("GearUp_Card-Shuffle");

			public static CardCategory tagCardManipulation = CustomCardCategories.instance.CardCategory("CardManipulation");

			public static CardCategory tagNoGlitch = CustomCardCategories.instance.CardCategory("NoRandom");

			public static CardCategory tagNoRemove = CustomCardCategories.instance.CardCategory("NoRemove");

			public static CardCategory tagNoTableFlip = CustomCardCategories.instance.CardCategory("NoFlip");

			public static CardCategory tagSpellOnlyAugment = CustomCardCategories.instance.CardCategory("GearUp_Spell-Only-Augment");

			internal static List<CardCategory> __gearCategories = null;

			public static List<CardCategory> GearCategories
			{
				get
				{
					if (__gearCategories == null)
					{
						__gearCategories = new List<CardCategory>();
						__gearCategories.Add(noType);
						__gearCategories.Add(typeBoosterPack);
						__gearCategories.Add(typeCardShuffle);
						__gearCategories.Add(typeGunMod);
						__gearCategories.Add(typeBlockMod);
						__gearCategories.Add(typeSizeMod);
						__gearCategories.Add(typeUniqueMagick);
						__gearCategories.Add(typeUniqueGunSpread);
						__gearCategories.Add(typeUniqueCAD);
						__gearCategories.Add(typeParts);
						__gearCategories.Add(typeCharm);
						__gearCategories.Add(typeGear);
						__gearCategories.Add(typeGlyph);
						__gearCategories.Add(typeSpell);
						__gearCategories.Add(typeCadModule);
					}
					return __gearCategories;
				}
			}
		}

		public class PlayerCardData : Object
		{
			public CardInfo cardInfo;

			public Player owner;

			public int index;

			public PlayerCardData(CardInfo cardInfo, Player owner, int index)
			{
				this.cardInfo = cardInfo;
				this.owner = owner;
				this.index = index;
			}
		}

		public class RarityDelta : Object
		{
			private static List<RarityDelta> rarityDeltas = new List<RarityDelta>();

			private CardInfo cardInfo;

			private float addDelta;

			private float mulDelta;

			private RarityDelta(CardInfo cardInfo, float add = 0f, float mul = 0f)
			{
				this.cardInfo = cardInfo;
				addDelta = add;
				mulDelta = mul;
			}

			private void Undo()
			{
				if ((Object)(object)cardInfo != (Object)null)
				{
					RarityUtils.AjustCardRarityModifier(cardInfo, -1f * addDelta, -1f * mulDelta);
					addDelta = 0f;
					mulDelta = 0f;
				}
			}

			public static void AdjustRarityModifier(CardInfo cardInfo, float add = 0f, float mul = 0f)
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)cardInfo == (Object)null)
				{
					return;
				}
				RarityUtils.AjustCardRarityModifier(cardInfo, add, mul);
				RarityDelta rarityDelta = null;
				Enumerator<RarityDelta> enumerator = rarityDeltas.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						RarityDelta current = enumerator.Current;
						if ((Object)(object)current.cardInfo == (Object)(object)cardInfo)
						{
							rarityDelta = current;
							break;
						}
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
				if (rarityDelta == null)
				{
					rarityDeltas.Add(new RarityDelta(cardInfo, add, mul));
					return;
				}
				rarityDelta.addDelta += add;
				rarityDelta.mulDelta += mul;
			}

			public static void UndoAll()
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				if (rarityDeltas == null)
				{
					return;
				}
				Enumerator<RarityDelta> enumerator = rarityDeltas.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						enumerator.Current.Undo();
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
				rarityDeltas.Clear();
			}
		}

		public class DestroyOnUnparent : MonoBehaviour
		{
			private void LateUpdate()
			{
				if ((Object)(object)((Component)this).gameObject.transform.parent == (Object)null)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}
		}

		internal class ExtraName : MonoBehaviour
		{
			private static GameObject _extraTextObj;

			public string text = "";

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

			public void Start()
			{
				//IL_0045: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				GameObject gameObject = ((Component)Enumerable.FirstOrDefault<RectTransform>(Enumerable.Where<RectTransform>((IEnumerable<RectTransform>)(object)((Component)this).gameObject.GetComponentsInChildren<RectTransform>(), (Func<RectTransform, bool>)((RectTransform obj) => ((Object)((Component)obj).gameObject).name == "EdgePart (1)")))).gameObject;
				GameObject obj2 = Object.Instantiate<GameObject>(extraTextObj, gameObject.transform.position, gameObject.transform.rotation, gameObject.transform);
				TextMeshProUGUI component = obj2.gameObject.GetComponent<TextMeshProUGUI>();
				((TMP_Text)component).text = text;
				((TMP_Text)component).enableWordWrapping = false;
				obj2.transform.Rotate(0f, 0f, 135f);
				obj2.transform.localScale = new Vector3(1f, 1f, 1f);
				obj2.transform.localPosition = new Vector3(-50f, -50f, 0f);
				((TMP_Text)component).alignment = (TextAlignmentOptions)1026;
				((TMP_Text)component).alpha = 0.1f;
				((TMP_Text)component).fontSize = 50f;
			}
		}

		public static bool cardCategoryHasRarity = false;

		public static Dictionary<Rarity, CardCategory> rarityCategories = new Dictionary<Rarity, CardCategory>();

		public static Dictionary<string, CardCategory> packCategories = new Dictionary<string, CardCategory>();

		public static List<string> gearUpRarityChecklist;

		public static Dictionary<string, float> raritySnapshot;

		public static List<string> cardListSpells;

		public static List<string> cardListGlyph;

		public static List<string> cardListVanillaBlocks;

		public static List<string> cardListModdedBlocks;

		public static Rarity TryQueryRarity(string query, string failSafe)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			List<Rarity> val = new List<Rarity>((IEnumerable<Rarity>)(object)rarityCategories.Keys);
			Enumerator<Rarity> enumerator = val.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Rarity current = enumerator.Current;
					if (current.name == query)
					{
						return current;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			enumerator = val.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Rarity current2 = enumerator.Current;
					if (current2.name == failSafe)
					{
						return current2;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return RarityUtils.GetRarityData((Rarity)0);
		}

		public static bool PlayerHasCard(Player player, string cardName)
		{
			return GetPlayerCardsWithName(player, cardName).Count > 0;
		}

		public static bool PlayerHasCardCategory(Player player, CardCategory cardCategory)
		{
			return GetPlayerCardsWithCategory(player, cardCategory).Count > 0;
		}

		public static List<PlayerCardData> GetPlayerCardsWithName(Player player, string targetCardName)
		{
			targetCardName = targetCardName.ToUpper();
			List<PlayerCardData> val = new List<PlayerCardData>();
			List<CardInfo> currentCards = player.data.currentCards;
			for (int i = 0; i < currentCards.Count; i++)
			{
				if (currentCards[i].cardName.ToUpper().Equals(targetCardName))
				{
					val.Add(new PlayerCardData(currentCards[i], player, i));
				}
			}
			return val;
		}

		public static List<PlayerCardData> GetPlayerCardsWithCategory(Player player, CardCategory targetCategory)
		{
			List<PlayerCardData> val = new List<PlayerCardData>();
			List<CardInfo> currentCards = player.data.currentCards;
			for (int i = 0; i < currentCards.Count; i++)
			{
				bool flag = false;
				CardCategory[] categoriesFromCard = CustomCardCategories.instance.GetCategoriesFromCard(currentCards[i]);
				foreach (CardCategory val2 in categoriesFromCard)
				{
					if ((Object)(object)targetCategory == (Object)(object)val2)
					{
						flag = true;
						break;
					}
				}
				if (flag)
				{
					val.Add(new PlayerCardData(currentCards[i], player, i));
				}
			}
			return val;
		}

		public static CardInfo GetCardInfo(string modInitial, string cardNameExact)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			string text = String.Concat("__", modInitial, "__", cardNameExact);
			List<CardInfo> obj = Enumerable.ToList<CardInfo>(Enumerable.Select<Card, CardInfo>((IEnumerable<Card>)(object)CardManager.cards.Values, (Func<Card, CardInfo>)((Card c) => c.cardInfo)));
			CardInfo result = null;
			Enumerator<CardInfo> enumerator = obj.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					CardInfo current = enumerator.Current;
					if (((Object)((Component)current).gameObject).name.Contains(text))
					{
						result = current;
						break;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return result;
		}

		public static CardInfo GetCardInfo(string query, bool searchVanillaOnly = false)
		{
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			if (query.Contains("@"))
			{
				List<string> val = Miscs.StringSplit(query, '@');
				if (val.Count == 2)
				{
					if (val[0] == "")
					{
						return GetCardInfo(val[1]);
					}
					if (val[0] == "Vanilla")
					{
						return GetCardInfo(val[1], searchVanillaOnly: true);
					}
					return GetCardInfo(val[0], val[1]);
				}
				Miscs.LogWarn(">> query splitting failed");
				query = val[0];
			}
			query = CardNameSanitize(query, removeWhitespaces: true);
			List<CardInfo> obj = Enumerable.ToList<CardInfo>(Enumerable.Select<Card, CardInfo>((IEnumerable<Card>)(object)CardManager.cards.Values, (Func<Card, CardInfo>)((Card c) => c.cardInfo)));
			CardInfo result = null;
			int num = 0;
			Enumerator<CardInfo> enumerator = obj.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					CardInfo current = enumerator.Current;
					string text = CardNameSanitize(((Object)((Component)current).gameObject).name, removeWhitespaces: true);
					if (searchVanillaOnly && text.Contains("__"))
					{
						continue;
					}
					text = CardNameSanitize(current.cardName, removeWhitespaces: true);
					if (text.Equals(query))
					{
						result = current;
						num = 9999;
						break;
					}
					if (text.Contains(query))
					{
						int num2 = Miscs.ValidateStringQuery(text, query);
						if (num2 > num)
						{
							num = num2;
							result = current;
						}
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return result;
		}

		public static List<PlayerCardData> GetPlayerCardsWithCardInfo(Player player, CardInfo cardInfo)
		{
			string text = ((Object)((Component)cardInfo).gameObject).name.ToUpper();
			List<PlayerCardData> val = new List<PlayerCardData>();
			List<CardInfo> currentCards = player.data.currentCards;
			for (int i = 0; i < currentCards.Count; i++)
			{
				if (((Object)((Component)currentCards[i]).gameObject).name.ToUpper().Equals(text))
				{
					val.Add(new PlayerCardData(currentCards[i], player, i));
				}
			}
			return val;
		}

		public static List<PlayerCardData> GetPlayerCardsWithStringList(Player player, List<string> checkList)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			List<PlayerCardData> val = new List<PlayerCardData>();
			_ = player.data.currentCards;
			Enumerator<string> enumerator = checkList.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					CardInfo cardInfo = GetCardInfo(enumerator.Current);
					if (!((Object)(object)cardInfo == (Object)null))
					{
						val = Enumerable.ToList<PlayerCardData>(Enumerable.Concat<PlayerCardData>((IEnumerable<PlayerCardData>)(object)val, (IEnumerable<PlayerCardData>)(object)GetPlayerCardsWithCardInfo(player, cardInfo)));
					}
				}
				return val;
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		public static void SaveCardRarity()
		{
			//IL_000f: 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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			Miscs.Log("[GearUp] SaveGearUpCardRarity()");
			Enumerator<string> enumerator = gearUpRarityChecklist.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					string current = enumerator.Current;
					string text = String.Concat("GearUP@", current);
					CardInfo cardInfo = GetCardInfo(text);
					if (!((Object)(object)cardInfo == (Object)null))
					{
						raritySnapshot[text] = RarityUtils.GetCardRarityModifier(cardInfo);
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			enumerator = cardListVanillaBlocks.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					string current2 = enumerator.Current;
					CardInfo cardInfo = GetCardInfo(current2);
					if (!((Object)(object)cardInfo == (Object)null))
					{
						raritySnapshot[current2] = RarityUtils.GetCardRarityModifier(cardInfo);
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			enumerator = cardListModdedBlocks.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					string current3 = enumerator.Current;
					CardInfo cardInfo = GetCardInfo(current3);
					if (!((Object)(object)cardInfo == (Object)null))
					{
						raritySnapshot[current3] = RarityUtils.GetCardRarityModifier(cardInfo);
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		public static void RestoreGearUpCardRarity()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			Miscs.Log("[GearUp] RestoreGearUpCardRarity()");
			Enumerator<string, float> enumerator = raritySnapshot.Keys.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					string current = enumerator.Current;
					CardInfo cardInfo = GetCardInfo(current);
					if (!((Object)(object)cardInfo == (Object)null))
					{
						float cardRarityModifier = RarityUtils.GetCardRarityModifier(cardInfo);
						RarityUtils.AjustCardRarityModifier(cardInfo, 0f, -1f * (cardRarityModifier / raritySnapshot[current] - 1f));
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		public static void BatchAdjustCardRarity(List<string> cardList, float add = 0f, float mul = 0f)
		{
			//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)
			Enumerator<string> enumerator = cardList.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					CardInfo cardInfo = GetCardInfo(enumerator.Current);
					if (!((Object)(object)cardInfo == (Object)null))
					{
						RarityDelta.AdjustRarityModifier(cardInfo, add, mul);
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		public static void ModifyPerPlayerCardRarity(int playerID)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Player val = null;
			if (playerID <= -1)
			{
				return;
			}
			Enumerator<Player> enumerator = PlayerManager.instance.players.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Player current = enumerator.Current;
					if (current.playerID == playerID)
					{
						val = current;
						break;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			if (!((Object)(object)val == (Object)null))
			{
				CharacterStatModifiersGearData gearData = ((Component)val).gameObject.GetComponent<CharacterStatModifiers>().GetGearData();
				float num = 0f;
				num += (float)gearData.glyphDivination * 2f;
				num += (float)gearData.glyphGeometric * 0.5f;
				num += (float)gearData.glyphInfluence * 1f;
				num += (float)gearData.glyphPotency * 0.5f;
				num += (float)gearData.glyphMagickFragment * 0.75f;
				num += (float)gearData.glyphTime * 0.5f;
				num += (float)gearData.glyphReplication * 0.5f;
				if (gearData.addOnList.Contains(GearUpConstants.AddOnType.cadModuleGlyph))
				{
					num *= 1.25f;
					BatchAdjustCardRarity(cardListGlyph, 0f, 1f);
				}
				else
				{
					RarityDelta.AdjustRarityModifier(GetCardInfo("GearUP", "Glyph CAD Module"), 0f, num * 1.5f - 0.75f);
				}
				BatchAdjustCardRarity(cardListSpells, 0f, num);
				RarityDelta.AdjustRarityModifier(GetCardInfo("GearUP", "Pure Canvas"), 0f, num * 0.5f - 0.5f);
				num = (float)gearData.orbLifeforceDualityStack * 0.5f;
				num += (float)gearData.orbLifeforceBlastStack * 0.5f;
				num += (float)gearData.orbObliterationStack * 0.5f;
				num += (float)gearData.orbRollingBulwarkStack * 0.5f;
				num += (float)gearData.arcaneSunStack * 0.5f;
				num += (float)gearData.mysticMissileStack * 0.5f;
				if (gearData.uniqueMagick != GearUpConstants.ModType.disabled && gearData.uniqueMagick != GearUpConstants.ModType.none)
				{
					num += 2f;
				}
				BatchAdjustCardRarity(cardListGlyph, 0f, num);
				RarityDelta.AdjustRarityModifier(GetCardInfo("GearUP", "Pure Canvas"), 0f, num * 0.5f);
				num = (float)gearData.shieldBatteryStack * 0.25f;
				num += (float)GetPlayerCardsWithName(val, "Empower").Count * 0.25f;
				num += (float)gearData.glyphMagickFragment * 0.5f;
				RarityDelta.AdjustRarityModifier(GetCardInfo("GearUP", "Shield Battery"), 0f, num * 2f);
				RarityDelta.AdjustRarityModifier(GetCardInfo("Empower", searchVanillaOnly: true), 0f, num * 2f);
				if (gearData.addOnList.Contains(GearUpConstants.AddOnType.charmGuardian))
				{
					BatchAdjustCardRarity(cardListVanillaBlocks, 0f, num * 2f);
					BatchAdjustCardRarity(cardListModdedBlocks, 0f, num);
				}
				List<PlayerCardData> playerCardsWithStringList = GetPlayerCardsWithStringList(val, cardListVanillaBlocks);
				num = (float)playerCardsWithStringList.Count * 0.2f;
				playerCardsWithStringList = GetPlayerCardsWithStringList(val, cardListModdedBlocks);
				num += (float)playerCardsWithStringList.Count * 0.1f;
				RarityDelta.AdjustRarityModifier(GetCardInfo("GearUP", "Shield Battery"), 0f, num);
				RarityDelta.AdjustRarityModifier(GetCardInfo("Empower", searchVanillaOnly: true), 0f, num);
				if (gearData.addOnList.Contains(GearUpConstants.AddOnType.charmGuardian))
				{
					BatchAdjustCardRarity(cardListVanillaBlocks, 0f, num * 2f + 3f);
					BatchAdjustCardRarity(cardListModdedBlocks, 0f, num + 1.5f);
				}
			}
		}

		public static string CardNameSanitize(string name, bool removeWhitespaces = false)
		{
			string text = name.ToLower();
			if (removeWhitespaces)
			{
				text = text.Replace(" ", "");
			}
			return text;
		}

		public static void MakeExclusive(string cardA, string cardB)
		{
			CardInfo cardInfo = GetCardInfo(cardA);
			CardInfo cardInfo2 = GetCardInfo(cardB);
			if ((Object)(object)cardInfo != (Object)null && (Object)(object)cardInfo2 != (Object)null)
			{
				CustomCardCategories.instance.MakeCardsExclusive(cardInfo, cardInfo2);
				Miscs.LogInfo(String.Concat((string[])(object)new String[5] { "[GearUp] MakeExclusive: card [", cardA, "] and card [", cardB, "] made exclusive" }));
			}
			else
			{
				if ((Object)(object)cardInfo == (Object)null)
				{
					Miscs.Log(String.Concat("[GearUp] MakeExclusive: card [", cardA, "] not found"));
				}
				if ((Object)(object)cardInfo2 == (Object)null)
				{
					Miscs.Log(String.Concat("[GearUp] MakeExclusive: card [", cardB, "] not found"));
				}
			}
		}

		static CardUtils()
		{
			List<string> obj = new List<string>();
			obj.Add("Anti-Bullet Magick");
			obj.Add("Orb-literation!");
			obj.Add("Rolling Borbwark");
			obj.Add("Lifeforce Duorbity");
			obj.Add("Lifeforce Blast!");
			obj.Add("Arcane Sun");
			obj.Add("Mystic Missile!");
			obj.Add("Divination Glyph");
			obj.Add("Geometric Glyph");
			obj.Add("Influence Glyph");
			obj.Add("Magick Fragments");
			obj.Add("Potency Glyph");
			obj.Add("Time Glyph");
			obj.Add("Replication Glyph");
			obj.Add("Tiberium Bullet");
			obj.Add("Glyph CAD Module");
			obj.Add("Shield Battery");
			obj.Add("Pure Canvas");
			gearUpRarityChecklist = obj;
			raritySnapshot = new Dictionary<string, float>();
			List<string> obj2 = new List<string>();
			obj2.Add("Anti-Bullet Magick");
			obj2.Add("Orb-literation!");
			obj2.Add("Rolling Borbwark");
			obj2.Add("Lifeforce Duorbity");
			obj2.Add("Lifeforce Blast!");
			obj2.Add("Arcane Sun");
			obj2.Add("Mystic Missile!");
			cardListSpells = obj2;
			List<string> obj3 = new List<string>();
			obj3.Add("Divination Glyph");
			obj3.Add("Geometric Glyph");
			obj3.Add("Influence Glyph");
			obj3.Add("Magick Fragments");
			obj3.Add("Potency Glyph");
			obj3.Add("Time Glyph");
			obj3.Add("Replication Glyph");
			cardListGlyph = obj3;
			List<string> obj4 = new List<string>();
			obj4.Add("Vanilla@Empower");
			obj4.Add("Vanilla@Bombs Away");
			obj4.Add("Vanilla@Defender");
			obj4.Add("Vanilla@EMP");
			obj4.Add("Vanilla@Frost Slam");
			obj4.Add("Vanilla@Healing Field");
			obj4.Add("Vanilla@Implode");
			obj4.Add("Vanilla@Overpower");
			obj4.Add("Vanilla@Radar Shot");
			obj4.Add("Vanilla@Saw");
			obj4.Add("Vanilla@Shield Charge");
			obj4.Add("Vanilla@Shockwave");
			obj4.Add("Vanilla@Silence");
			obj4.Add("Vanilla@Static Field");
			obj4.Add("Vanilla@Supernova");
			obj4.Add("Vanilla@Teleport");
			cardListVanillaBlocks = obj4;
			List<string> obj5 = new List<string>();
			obj5.Add("GearUP@Magick Fragments");
			obj5.Add("GearUP@Shield Battery");
			obj5.Add("GearUP@Tactical Scanner");
			obj5.Add("GearUP@Rolling Borbwark");
			obj5.Add("Cards+@Turtle");
			obj5.Add("CR@Aqua Ring");
			obj5.Add("CR@Barrier");
			obj5.Add("CR@Gravity");
			obj5.Add("CR@Halo");
			obj5.Add("CR@Heartition");
			obj5.Add("CR@Hive");
			obj5.Add("CR@Holster");
			obj5.Add("CR@Ignite");
			obj5.Add("CR@Mitosis");
			obj5.Add("CR@Ping");
			obj5.Add("CR@Speed Up");
			obj5.Add("HDC@Divine Blessing");
			obj5.Add("HDC@Lil Defensive");
			obj5.Add("Root@Quick Shield");
			obj5.Add("PCE@Discombobulate");
			obj5.Add("PCE@Super Jump");
			cardListModdedBlocks = obj5;
		}
	}
	public class MapUtils : MonoBehaviour
	{
		public class MapObject : Object
		{
			public enum MapObjectType : Enum
			{
				invalid = -1,
				generic,
				background,
				buzzSaw,
				boxDestructible,
				mapExtendedWWMOZones
			}

			public GameObject gameObject;

			public MapObjectType type;

			public MapObject(GameObject gameObject, MapObjectType type)
			{
				this.gameObject = gameObject;
				this.type = type;
			}

			public static MapObjectType CheckMapObject(GameObject gameObject)
			{
				if (!gameObject.activeInHierarchy)
				{
					return MapObjectType.invalid;
				}
				if (Object.op_Implicit((Object)(object)gameObject.GetComponent<CircleCollider2D>()) && Object.op_Implicit((Object)(object)gameObject.GetComponent<DamageBox>()))
				{
					return MapObjectType.buzzSaw;
				}
				if (Object.op_Implicit((Object)(object)gameObject.GetComponent<PolygonCollider2D>()) && Object.op_Implicit((Object)(object)gameObject.GetComponent<DamageBox>()))
				{
					return MapObjectType.buzzSaw;
				}
				if (Object.op_Implicit((Object)(object)gameObject.GetComponent<BoxCollider2D>()) && Object.op_Implicit((Object)(object)gameObject.GetComponent<DestructibleBoxDestruction>()))
				{
					return MapObjectType.boxDestructible;
				}
				if (Object.op_Implicit((Object)(object)gameObject.GetComponent<SpriteRenderer>()) && ((Object)gameObject).name.Contains("WWMO.MapObjects") && Object.op_Implicit((Object)(object)gameObject.GetComponent<BoxCollider2D>()))
				{
					return MapObjectType.mapExtendedWWMOZones;
				}
				if (Object.op_Implicit((Object)(object)gameObject.GetComponent<SpriteRenderer>()) && Object.op_Implicit((Object)(object)gameObject.GetComponent<BoxCollider2D>()))
				{
					if (!((Behaviour)gameObject.GetComponent<SFPolygon>()).isActiveAndEnabled)
					{
						return MapObjectType.background;
					}
					return MapObjectType.generic;
				}
				if (Object.op_Implicit((Object)(object)gameObject.GetComponent<SpriteRenderer>()) && Object.op_Implicit((Object)(object)gameObject.GetComponent<CircleCollider2D>()))
				{
					if (!((Behaviour)gameObject.GetComponent<SFPolygon>()).isActiveAndEnabled)
					{
						return MapObjectType.background;
					}
					return MapObjectType.generic;
				}
				if (Object.op_Implicit((Object)(object)gameObject.GetComponent<SpriteRenderer>()) && Object.op_Implicit((Object)(object)gameObject.GetComponent<PolygonCollider2D>()))
				{
					if (!((Behaviour)gameObject.GetComponent<SFPolygon>()).isActiveAndEnabled)
					{
						return MapObjectType.background;
					}
					return MapObjectType.generic;
				}
				return MapObjectType.invalid;
			}
		}

		public static List<MapObject> mapObjects;

		public static Scene mapScene;

		[PunRPC]
		public static bool RPCA_UpdateMapObjectsList()
		{
			//IL_00a7: Expected O, but got Unknown
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (mapObjects != null)
				{
					ClearMapObjectsList();
				}
				mapScene = SceneManager.GetSceneAt(1);
				if (!((Scene)(ref mapScene)).IsValid())
				{
					return false;
				}
				GameObject val = ((Scene)(ref mapScene)).GetRootGameObjects()[0];
				if (!Object.op_Implicit((Object)(object)val))
				{
					return false;
				}
				Transform[] componentsInChildren = val.GetComponentsInChildren<Transform>();
				mapObjects = new List<MapObject>();
				Transform[] array = componentsInChildren;
				foreach (Transform val2 in array)
				{
					MapObject.MapObjectType mapObjectType = MapObject.CheckMapObject(((Component)val2).gameObject);
					if (mapObjectType != MapObject.MapObjectType.invalid)
					{
						mapObjects.Add(new MapObject(((Component)val2).gameObject, mapObjectType));
					}
				}
				return true;
			}
			catch (Exception val3)
			{
				Miscs.LogError("[GearUp] MapDestructionMono.RPCA_UpdateMapObjectsList failed and caught!");
				Miscs.LogError((object)val3);
				return false;
			}
		}

		[PunRPC]
		public static bool RPCA_DestroyMapObject(GameObject gameObject)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			if ((Object)(object)gameObject == (Object)null)
			{
				Miscs.Log("[GearUp] RPCA_DestroyMapObject: Game object not loaded!");
				return false;
			}
			bool flag = RPCA_UpdateMapObjectsList();
			string name = ((Scene)(ref mapScene)).name;
			Scene scene = gameObject.scene;
			if (!name.Equals(((Scene)(ref scene)).name))
			{
				Miscs.Log("[GearUp] RPCA_DestroyMapObject: Not a map game object!");
				return false;
			}
			if (flag)
			{
				bool flag2 = false;
				Enumerator<MapObject> enumerator = mapObjects.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						if (enumerator.Current.gameObject == gameObject)
						{
							flag2 = true;
							break;
						}
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
				if (flag2)
				{
					Miscs.Log(String.Concat("[GearUp] RPCA_DestroyMapObject: destroying [", ((Object)gameObject).name, "]"));
					Object.Destroy((Object)(object)gameObject);
					return true;
				}
				Miscs.Log("[GearUp] RPCA_DestroyMapObject: target game object not exist/valid!");
				return false;
			}
			return false;
		}

		public static bool RPCA_DestroyMapObjectsAtArea(Vector3 groundZero, float radius)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_007c: 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)
			if (RPCA_UpdateMapObjectsList())
			{
				Miscs.Log(String.Format("[GearUp] Area Map Destroy Ground Zero: [{0}]", (object)groundZero));
				Enumerator<MapObject> enumerator = mapObjects.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						MapObject current = enumerator.Current;
						if (!((Object)(object)current.gameObject == (Object)null) && current.gameObject.activeInHierarchy)
						{
							Vector3 val = Vector3.Scale(current.gameObject.transform.position, new Vector3(1f, 1f, 0f)) - groundZero;
							if (((Vector3)(ref val)).magnitude <= radius)
							{
								Miscs.Log(String.Concat("[GearUp] RPCA_DestroyMapObject: destroying [", ((Object)current.gameObject).name, "]"));
								Object.Destroy((Object)(object)current.gameObject);
								current.gameObject = null;
							}
						}
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
				return true;
			}
			return false;
		}

		public static void ClearMapObjectsList()
		{
			if (mapObjects != null)
			{
				mapObjects.Clear();
			}
			mapObjects = null;
		}

		public static bool CheckPointInMapObject(Vector3 position, List<MapObject.MapObjectType> ignoreList)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(position.x, position.y);
			bool result = false;
			if (ignoreList == null)
			{
				ignoreList = new List<MapObject.MapObjectType>();
			}
			Enumerator<MapObject> enumerator = mapObjects.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					MapObject current = enumerator.Current;
					if (!ignoreList.Contains(current.type))
					{
						Collider2D component = current.gameObject.GetComponent<Collider2D>();
						if ((Object)(object)component != (Object)null && component.OverlapPoint(val))
						{
							result = true;
							break;
						}
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return result;
		}
	}
	internal class Miscs : Object
	{
		public class RemoveAfterSpawn : MonoBehaviour
		{
			public float timeToRemove;

			private void Update()
			{
				if (!((Object)(object)((Component)this).gameObject.GetComponent<SpawnedAttack>() == (Object)null))
				{
					RemoveAfterSeconds orAddComponent = ExtensionMethods.GetOrAddComponent<RemoveAfterSeconds>(((Component)this).gameObject, false);
					orAddComponent.seconds = timeToRemove;
					((Behaviour)orAddComponent).enabled = true;
					Object.Destroy((Object)(object)this);
				}
			}
		}

		public class SetColorToParticles : MonoBehaviour
		{
			public List<ParticleSystem> particleSystems = new List<ParticleSystem>();

			private Dictionary<ParticleSystem, Gradient> backupGradients = new Dictionary<ParticleSystem, Gradient>();

			public Color targetColor;

			public bool overrideHue = true;

			private void Awake()
			{
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Expected O, but got Unknown
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0108: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				particleSystems.Clear();
				backupGradients.Clear();
				particleSystems.AddRange((IEnumerable<ParticleSystem>)(object)((Component)this).gameObject.GetComponentsInChildren<ParticleSystem>());
				Enumerator<ParticleSystem> enumerator = particleSystems.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						ParticleSystem current = enumerator.Current;
						Gradient val = new Gradient();
						ColorOverLifetimeModule colorOverLifetime = current.colorOverLifetime;
						MinMaxGradient color = ((ColorOverLifetimeModule)(ref colorOverLifetime)).color;
						Gradient gradient = ((MinMaxGradient)(ref color)).gradient;
						val.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[gradient.alphaKeys.Length];
						for (int i = 0; i < gradient.alphaKeys.Length; i++)
						{
							val.alphaKeys[i] = new GradientAlphaKey(gradient.alphaKeys[i].alpha, gradient.alphaKeys[i].time);
						}
						val.colorKeys = (GradientColorKey[])(object)new GradientColorKey[gradient.colorKeys.Length];
						for (int j = 0; j < gradient.colorKeys.Length; j++)
						{
							val.colorKeys[j] = new GradientColorKey(gradient.colorKeys[j].color, gradient.colorKeys[j].time);
						}
						if (!backupGradients.ContainsKey(current))
						{
							backupGradients.Add(current, val);
						}
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
			}

			private void Update()
			{
				if (overrideHue)
				{
					SetHueAll();
				}
			}

			public void SetHueAll()
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Expected O, but got Unknown
				//IL_0059: 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_0084: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
				Enumerator<ParticleSystem> enumerator = particleSystems.GetEnumerator();
				try
				{
					float num = default(float);
					float num2 = default(float);
					float num3 = default(float);
					float num4 = default(float);
					float num5 = default(float);
					while (enumerator.MoveNext())
					{
						ParticleSystem current = enumerator.Current;
						ColorOverLifetimeModule colorOverLifetime = current.colorOverLifetime;
						MinMaxGradient color = ((ColorOverLifetimeModule)(ref colorOverLifetime)).color;
						Gradient gradient = ((MinMaxGradient)(ref color)).gradient;
						Gradient val = new Gradient();
						GradientColorKey[] array = (GradientColorKey[])(object)new GradientColorKey[gradient.colorKeys.Length];
						for (int i = 0; i < gradient.colorKeys.Length; i++)
						{
							Color.RGBToHSV(gradient.colorKeys[i].color, ref num, ref num2, ref num3);
							Color.RGBToHSV(targetColor, ref num4, ref num, ref num5);
							array[i] = new GradientColorKey(Color.HSVToRGB(num4, num2, num3), gradient.colorKeys[i].time);
						}
						val.SetKeys(array, gradient.alphaKeys);
						ColorOverLifetimeModule colorOverLifetime2 = current.colorOverLifetime;
						((ColorOverLifetimeModule)(ref colorOverLifetime2)).color = MinMaxGradient.op_Implicit(val);
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
			}
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c : Object
		{
			public static readonly <>c <>9 = new <>c();

			public static Action<GameObject> <>9__11_0;

			public static Action <>9__11_1;

			internal void <CopyGunStatsNoActions>b__11_0(GameObject _)
			{
			}

			internal void <CopyGunStatsNoActions>b__11_1()
			{
			}
		}

		public static bool debugFlag = true;

		public static void LogInfo(object message)
		{
			Debug.Log(message);
		}

		public static void Log(object message)
		{
			if (debugFlag)
			{
				Debug.Log(message);
			}
		}

		public static void LogWarn(object message)
		{
			if (debugFlag)
			{
				Debug.LogWarning(message);
			}
		}

		public static void LogError(object message)
		{
			if (debugFlag)
			{
				Debug.LogError(message);
			}
		}

		public static Vector3 RotateVector(Vector3 vector, float degree)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Sin(degree * ((float)Math.PI / 180f));
			float num2 = Mathf.Cos(degree * ((float)Math.PI / 180f));
			float x = vector.x;
			float y = vector.y;
			vector.x = num2 * x - num * y;
			vector.y = num * x + num2 * y;
			return vector;
		}

		public static List<string> StringSplit(string input, char splitAt)
		{
			List<string> val = new List<string>();
			string text = "";
			for (int i = 0; i < input.Length; i++)
			{
				if (input[i] != splitAt)
				{
					string text2 = text;
					char c = input[i];
					text = String.Concat(text2, ((Char)(ref c)).ToString());
				}
				else
				{
					val.Add(text);
					text = "";
				}
			}
			if (text != "")
			{
				val.Add(text);
			}
			return val;
		}

		public static int ValidateStringQuery(string targetString, string query)
		{
			int num = 15;
			int num2 = 0;
			int num3 = 0;
			bool flag = true;
			for (int i = 0; i < targetString.Length; i++)
			{
				if (targetString[i] == query[num2])
				{
					num3 += num;
					num2++;
				}
				else
				{
					flag = false;
					num--;
					num2++;
				}
				if (num2 == query.Length)
				{
					if (flag)
					{
						num3 += num * 10;
					}
					break;
				}
			}
			return num3;
		}

		public static void CopyGunStats(Gun copyFromGun, Gun copyToGun)
		{
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Expected O, but got Unknown
			Log("CopyGunStats() : calling base");
			CopyGunStatsBase(copyFromGun, copyToGun);
			Log("CopyGunStats() : cloning ShootPojectileAction");
			if (copyFromGun.ShootPojectileAction != null)
			{
				copyToGun.ShootPojectileAction = (Action<GameObject>)((Delegate)copyFromGun.ShootPojectileAction).Clone();
			}
			copyToGun.shootPosition = copyFromGun.shootPosition;
			Log("CopyGunStats() : cloning attackAction");
			Action value = Traverse.Create((object)copyFromGun).Field("attackAction").GetValue<Action>();
			if (value != null)
			{
				Traverse.Create((object)copyToGun).Field("attackAction").SetValue((object)(Action)((Delegate)value).Clone());
			}
			Log("CopyGunStats() : finishing");
			Traverse.Create((object)copyToGun).Field("spreadOfLastBullet").SetValue((object)(Single)Traverse.Create((object)copyFromGun).Field("spreadOfLastBullet").GetValue());
			Traverse.Create((object)copyToGun).Field("forceShootDir").SetValue((object)(Vector3)Traverse.Create((object)copyFromGun).Field("forceShootDir").GetValue());
		}

		public static void CopyGunStatsNoActions(Gun copyFromGun, Gun copyToGun)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			CopyGunStatsBase(copyFromGun, copyToGun);
			((Weapon)copyToGun).holdable = null;
			copyToGun.ShootPojectileAction = delegate
			{
			};
			object obj = <>c.<>9__11_1;
			if (obj == null)
			{
				Action val = delegate
				{
				};
				<>c.<>9__11_1 = val;
				obj = (object)val;
			}
			Action value = (Action)obj;
			Traverse.Create((object)copyToGun).Field("attackAction").SetValue((object)value);
			Traverse.Create((object)copyToGun).Field("spreadOfLastBullet").SetValue((object)(Single)Traverse.Create((object)copyFromGun).Field("spreadOfLastBullet").GetValue());
			Traverse.Create((object)copyToGun).Field("forceShootDir").SetValue((object)(Vector3)Traverse.Create((object)copyFromGun).Field("forceShootDir").GetValue());
		}

		public static void CopyGunStatsBase(Gun copyFromGun, Gun copyToGun)
		{
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			copyToGun.ammo = copyFromGun.ammo;
			copyToGun.ammoReg = copyFromGun.ammoReg;
			copyToGun.attackID = copyFromGun.attackID;
			copyToGun.attackSpeed = copyFromGun.attackSpeed;
			copyToGun.attackSpeedMultiplier = copyFromGun.attackSpeedMultiplier;
			copyToGun.bodyRecoil = copyFromGun.bodyRecoil;
			copyToGun.bulletDamageMultiplier = copyFromGun.bulletDamageMultiplier;
			copyToGun.bulletPortal = copyFromGun.bulletPortal;
			copyToGun.bursts = copyFromGun.bursts;
			copyToGun.chargeDamageMultiplier = copyFromGun.chargeDamageMultiplier;
			copyToGun.chargeEvenSpreadTo = copyFromGun.chargeEvenSpreadTo;
			copyToGun.chargeNumberOfProjectilesTo = copyFromGun.chargeNumberOfProjectilesTo;
			copyToGun.chargeRecoilTo = copyFromGun.chargeRecoilTo;
			copyToGun.chargeSpeedTo = copyFromGun.chargeSpeedTo;
			copyToGun.chargeSpreadTo = copyFromGun.chargeSpreadTo;
			copyToGun.cos = copyFromGun.cos;
			copyToGun.currentCharge = copyFromGun.currentCharge;
			copyToGun.damage = copyFromGun.damage;
			copyToGun.damageAfterDistanceMultiplier = copyFromGun.damageAfterDistanceMultiplier;
			copyToGun.defaultCooldown = copyFromGun.defaultCooldown;
			copyToGun.destroyBulletAfter = copyFromGun.destroyBulletAfter;
			copyToGun.dmgMOnBounce = copyFromGun.dmgMOnBounce;
			copyToGun.dontAllowAutoFire = copyFromGun.dontAllowAutoFire;
			copyToGun.drag = copyFromGun.drag;
			copyToGun.dragMinSpeed = copyFromGun.dragMinSpeed;
			copyToGun.evenSpread = copyFromGun.evenSpread;
			copyToGun.explodeNearEnemyDamage = copyFromGun.explodeNearEnemyDamage;
			copyToGun.explodeNearEnemyRange = copyFromGun.explodeNearEnemyRange;
			copyToGun.forceSpecificAttackSpeed = copyFromGun.forceSpecificAttackSpeed;
			copyToGun.forceSpecificShake = copyFromGun.forceSpecificShake;
			copyToGun.gravity = copyFromGun.gravity;
			copyToGun.hitMovementMultiplier = copyFromGun.hitMovementMultiplier;
			copyToGun.ignoreWalls = copyFromGun.ignoreWalls;
			copyToGun.isProjectileGun = copyFromGun.isProjectileGun;
			copyToGun.isReloading = copyFromGun.isReloading;
			copyToGun.knockback = copyFromGun.knockback;
			copyToGun.lockGunToDefault = copyFromGun.lockGunToDefault;
			copyToGun.multiplySpread = copyFromGun.multiplySpread;
			copyToGun.numberOfProjectiles = copyFromGun.numberOfProjectiles;
			copyToGun.overheatMultiplier = copyFromGun.overheatMultiplier;
			copyToGun.percentageDamage = copyFromGun.percentageDamage;
			copyToGun.player = copyFromGun.player;
			copyToGun.projectielSimulatonSpeed = copyFromGun.projectielSimulatonSpeed;
			copyToGun.projectileColor = copyFromGun.projectileColor;
			copyToGun.projectileSize = copyFromGun.projectileSize;
			copyToGun.projectileSpeed = copyFromGun.projectileSpeed;
			copyToGun.randomBounces = copyFromGun.randomBounces;
			copyToGun.recoil = copyFromGun.recoil;
			copyToGun.recoilMuiltiplier = copyFromGun.recoilMuiltiplier;
			copyToGun.reflects = copyFromGun.reflects;
			copyToGun.reloadTime = copyFromGun.reloadTime;
			copyToGun.reloadTimeAdd = copyFromGun.reloadTimeAdd;
			copyToGun.shake = copyFromGun.shake;
			copyToGun.shakeM = copyFromGun.shakeM;
			((Weapon)copyToGun).sinceAttack = ((Weapon)copyFromGun).sinceAttack;
			copyToGun.size = copyFromGun.size;
			copyToGun.slow = copyFromGun.slow;
			copyToGun.smartBounce = copyFromGun.smartBounce;
			copyToGun.spawnSkelletonSquare = copyFromGun.spawnSkelletonSquare;
			copyToGun.speedMOnBounce = copyFromGun.speedMOnBounce;
			copyToGun.spread = copyFromGun.spread;
			copyToGun.teleport = copyFromGun.teleport;
			copyToGun.timeBetweenBullets = copyFromGun.timeBetweenBullets;
			copyToGun.timeToReachFullMovementMultiplier = copyFromGun.timeToReachFullMovementMultiplier;
			copyToGun.unblockable = copyFromGun.unblockable;
			copyToGun.useCharge = copyFromGun.useCharge;
			copyToGun.waveMovement = copyFromGun.waveMovement;
			copyToGun.objectsToSpawn = Enumerable.ToList<ObjectsToSpawn>((IEnumerable<ObjectsToSpawn>)(object)copyFromGun.objectsToSpawn).ToArray();
			copyToGun.projectiles = Enumerable.ToList<ProjectilesToSpawn>((IEnumerable<ProjectilesToSpawn>)(object)copyFromGun.projectiles).ToArray();
		}
	}
	internal class PlayerCardResolver : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass1_0 : Object
		{
			public string cardNameToAdd;

			internal bool <ResolveCardCategory>b__0(CardInfo card)
			{
				return ((Object)card).name == cardNameToAdd;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass2_0 : Object
		{
			public CardCategory categoryToCheck;

			internal bool <UpdateCategoryBlacklist>b__0(CardCategory category)
			{
				return (Object)(object)category == (Object)(object)categoryToCheck;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass3_0 : Object
		{
			public CardCategory categoryToCheck;

			internal bool <UpdateCategoryWhitelist>b__0(CardCategory category)
			{
				return (Object)(object)category == (Object)(object)categoryToCheck;
			}
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		public static IEnumerator Resolve(Player player)
		{
			yield return ResolveCardCategory(player, CardUtils.GearCategory.typeSizeMod, "Medical Parts");
			yield return ResolveCardCategory(player, CardUtils.GearCategory.typeUniqueMagick, "Magick Fragments");
			yield return ResolveCardCategory(player, CardUtils.GearCategory.typeUniqueGunSpread, "Gun Parts");
			yield return UpdateCategoryBlacklist(player, CardUtils.GearCategory.typeSizeMod);
			yield return UpdateCategoryBlacklist(player, CardUtils.GearCategory.typeUniqueMagick);
			yield return UpdateCategoryBlacklist(player, CardUtils.GearCategory.typeUniqueGunSpread);
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		public static IEnumerator ResolveCardCategory(Player player, CardCategory category, string cardNameToAdd)
		{
			<>c__DisplayClass1_0 CS$<>8__locals0 = new <>c__DisplayClass1_0();
			CS$<>8__locals0.cardNameToAdd = cardNameToAdd;
			List<CardUtils.PlayerCardData> conflictedCards = CardUtils.GetPlayerCardsWithCategory(player, category);
			Enumerator<CardUtils.PlayerCardData> enumerator = conflictedCards.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					CardUtils.PlayerCardData current = enumerator.Current;
					Debug.Log((object)String.Format("[{0}] - [{1}] - [{2}]", (object)current.cardInfo.cardName, (object)current.index, (object)current.owner.playerID));
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			if (conflictedCards.Count >= 1)
			{
				CardInfo replacementCard = Enumerable.ToArray<CardInfo>(Enumerable.Where<CardInfo>((IEnumerable<CardInfo>)(object)Cards.all, (Func<CardInfo, bool>)((CardInfo card) => ((Object)card).name == CS$<>8__locals0.cardNameToAdd)))[0];
				for (int i = conflictedCards.Count - 1; i > 0; i--)
				{
					yield return Cards.instance.ReplaceCard(player, conflictedCards[i].index, replacementCard, "", 2f, 2f, true);
					yield return new WaitForSecondsRealtime(0.1f);
				}
			}
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		public static IEnumerator UpdateCategoryBlacklist(Player player, CardCategory categoryToCheck)
		{
			<>c__DisplayClass2_0 CS$<>8__locals0 = new <>c__DisplayClass2_0();
			CS$<>8__locals0.categoryToCheck = categoryToCheck;
			List<CardUtils.PlayerCardData> playerCardsWithCategory = CardUtils.GetPlayerCardsWithCategory(player, CS$<>8__locals0.categoryToCheck);
			Debug.Log((object)String.Format("Player[{0}] Check blacklist for [{1}] >> found [{2}]", (object)player.playerID, (object)((Object)CS$<>8__locals0.categoryToCheck).name, (object)playerCardsWithCategory.Count));
			if (playerCardsWithCategory.Count == 0)
			{
				CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.RemoveAll((Predicate<CardCategory>)((CardCategory category) => (Object)(object)category == (Object)(object)CS$<>8__locals0.categoryToCheck));
			}
			else
			{
				CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.Add(CS$<>8__locals0.categoryToCheck);
			}
			yield break;
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		public static IEnumerator UpdateCategoryWhitelist(Player player, CardCategory categoryToCheck)
		{
			<>c__DisplayClass3_0 CS$<>8__locals0 = new <>c__DisplayClass3_0();
			CS$<>8__locals0.categoryToCheck = categoryToCheck;
			if (CardUtils.GetPlayerCardsWithCategory(player, CS$<>8__locals0.categoryToCheck).Count > 0)
			{
				CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.RemoveAll((Predicate<CardCategory>)((CardCategory category) => (Object)(object)category == (Object)(object)CS$<>8__locals0.categoryToCheck));
			}
			else
			{
				CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.Add(CS$<>8__locals0.categoryToCheck);
			}
			yield break;
		}
	}
	internal class StatsMath : Object
	{
		public static float GetGunBPS(Gun gun)
		{
			if ((Object)(object)gun == (Object)null)
			{
				return 0f;
			}
			float attackSpeed = gun.attackSpeed;
			int numberOfProjectiles = gun.numberOfProjectiles;
			float timeBetweenBullets = gun.timeBetweenBullets;
			int bursts = gun.bursts;
			if (bursts > 1)
			{
				attackSpeed += (float)(bursts - 1) * timeBetweenBullets;
				return (float)(bursts * numberOfProjectiles) / attackSpeed;
			}
			return (float)numberOfProjectiles / attackSpeed;
		}

		public static float GetGunAPS(Gun gun)
		{
			if ((Object)(object)gun == (Object)null)
			{
				return 0f;
			}
			float num = gun.attackSpeed;
			float timeBetweenBullets = gun.timeBetweenBullets;
			int bursts = gun.bursts;
			if (bursts > 1)
			{
				num += (float)(bursts - 1) * timeBetweenBullets;
			}
			return 1f / num;
		}

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

		public static bool ApproxEqual(float numA, float numB, float precision = 0.01f)
		{
			return Mathf.Abs(numA - numB) <= precision;
		}
	}
}
namespace GearUpCards.Patches
{
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class BounceEffectRetarget_Patch : Object
	{
		[HarmonyPostfix]
		[HarmonyPriority(800)]
		[HarmonyPatch("FindTarget")]
		private static void FindTargetRework(MoveTransform ___move, ref Player __result, ref HitInfo hit)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_008c: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			List<Player> val = new List<Player>((IEnumerable<Player>)(object)PlayerManager.instance.players);
			Vector3 val2 = ((Component)___move).transform.position + Vector2.op_Implicit(hit.normal) * 0.25f;
			__result = null;
			float num = 1f / 0f;
			if ((Object)(object)hit.transform != (Object)null && Object.op_Implicit((Object)(object)((Component)hit.transform).GetComponent<Player>()))
			{
				val.Remove(((Component)hit.transform).GetComponent<Player>());
			}
			Enumerator<Player> enumerator = val.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Player current = enumerator.Current;
					if (PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(val2), current).canSee && PlayerStatus.PlayerAliveAndSimulated(current) && !current.data.healthHandler.isRespawning)
					{
						Vector3 val3 = val2 - ((Component)current).transform.position;
						float magnitude = ((Vector3)(ref val3)).magnitude;
						if ((Object)(object)__result == (Object)null)
						{
							__result = current;
							num = magnitude;
						}
						else if (magnitude < num)
						{
							__result = current;
							num = magnitude;
						}
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class CharacterStatModifiers_Patch : Object
	{
		[HarmonyPostfix]
		[HarmonyPriority(0)]
		[HarmonyPatch("ConfigureMassAndSize")]
		private static void ApplySizeAdjustment(CharacterStatModifiers __instance)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = ((Component)__instance).gameObject.transform;
			GearUpConstants.ModType sizeMod = __instance.GetGearData().sizeMod;
			if (sizeMod != GearUpConstants.ModType.sizeNormalize)
			{
				_ = 21;
			}
			else
			{
				transform.localScale = Vector3.one * 1.2f;
			}
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class Empower_Patch : Object
	{
		[HarmonyPrefix]
		[HarmonyPriority(800)]
		[HarmonyPatch("Attack")]
		private static void AddBulletVisual(bool ___empowered, ref GameObject projectile)
		{
			if (Object.op_Implicit((Object)(object)projectile.GetComponent<SpawnedAttack>()) && ___empowered)
			{
				((Component)projectile.transform.root).gameObject.AddComponent<CustomEmpowerVFX>();
			}
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class HealthHandler_Patch : Object
	{
		private static float GetHealMultiplier(Player ___player)
		{
			float num = 1f;
			TacticalScannerStatus component = ((Component)___player).GetComponent<TacticalScannerStatus>();
			if ((Object)(object)component != (Object)null)
			{
				num *= component.GetHealMultiplier();
			}
			HollowLifeEffect component2 = ((Component)___player).GetComponent<HollowLifeEffect>();
			if ((Object)(object)component2 != (Object)null)
			{
				num *= component2.GetHealMultiplier();
			}
			LifeforceBlastStatus component3 = ((Component)___player).GetComponent<LifeforceBlastStatus>();
			if ((Object)(object)component3 != (Object)null)
			{
				num *= component3.GetHealMultiplier();
			}
			return num;
		}

		private static float GetDamageMultiplier(Player ___player)
		{
			float num = 1f;
			TacticalScannerStatus component = ((Component)___player).GetComponent<TacticalScannerStatus>();
			if ((Object)(object)component != (Object)null)
			{
				num *= component.GetDamageMultiplier();
			}
			ArcaneSunStatus component2 = ((Component)___player).GetComponent<ArcaneSunStatus>();
			if ((Object)(object)component2 != (Object)null)
			{
				num *= component2.GetDamageMultiplier();
			}
			ArcaneSunEffect component3 = ((Component)___player).GetComponent<ArcaneSunEffect>();
			if ((Object)(object)component3 != (Object)null)
			{
				num *= Mathf.Pow(1.15f, (float)component3.stackCount);
			}
			return num;
		}

		[HarmonyPrefix]
		[HarmonyPriority(800)]
		[HarmonyPatch("Heal")]
		private static void ApplyHealMultiplier(Player ___player, ref float healAmount)
		{
			if (healAmount > 0f)
			{
				healAmount *= GetHealMultiplier(___player);
			}
			else if (healAmount < 0f)
			{
				healAmount *= GetDamageMultiplier(___player);
			}
		}

		[HarmonyPrefix]
		[HarmonyPriority(0)]
		[HarmonyPatch("Heal")]
		private static bool NegativeHealRework(Player ___player, ref float healAmount)
		{
			if (healAmount >= 0f)
			{
				return true;
			}
			CharacterData data = ___player.data;
			data.health += healAmount;
			return false;
		}

		[HarmonyPrefix]
		[HarmonyPriority(800)]
		[HarmonyPatch("DoDamage")]
		private static void ApplyDamageMultiplier(HealthHandler __instance, ref Vector2 damage, Player ___player)
		{
			//IL_0002: 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_0012: Unknown result type (might be due to invalid IL or missing references)
			damage *= GetDamageMultiplier(___player);
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class RayHitReflect_Patch : Object
	{
		private static float constDisplacement = 0.15f;

		private static float scaledDisplacement = 0.002f;

		[HarmonyPostfix]
		[HarmonyPriority(800)]
		[HarmonyPatch("DoHitEffect")]
		private static void DoHitEffectPostFix(ref MoveTransform ___move, int ___reflects, HitInfo hit)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)hit.transform == (Object)null && ___reflects > 0)
			{
				Transform transform = ((Component)___move).transform;
				transform.position += Vector2.op_Implicit(hit.normal) * (((Vector3)(ref ___move.velocity)).magnitude * scaledDisplacement + constDisplacement);
			}
		}
	}
}
namespace GearUpCards.MonoBehaviours
{
	public class ChompyBulletModifier : RayHitEffect
	{
		private const float healthCullBaseFactor = 0.75f;

		private float healthCullPercentage;

		public override HasToReturn DoHitEffect(HitInfo hit)
		{
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)hit.transform == (Object)null))
			{
				if (!((Component)hit.transform).gameObject.tag.Contains("Bullet"))
				{
					if (Object.op_Implicit((Object)(object)((Component)hit.transform).GetComponent<Player>()))
					{
						ProjectileHit componentInParent = ((Component)this).gameObject.GetComponentInParent<ProjectileHit>();
						Player ownPlayer = componentInParent.ownPlayer;
						Gun component = componentInParent.ownWeapon.GetComponent<Gun>();
						CharacterStatModifiers component2 = ((Component)ownPlayer).gameObject.GetComponent<CharacterStatModifiers>();
						healthCullPercentage = Mathf.Pow(0.75f, (float)component2.GetGearData().chompyBulletStack);
						float num = 1f - healthCullPercentage;
						CharacterData component3 = ((Component)hit.transform).gameObject.GetComponent<CharacterData>();
						float gunBPS = StatsMath.GetGunBPS(component);
						float num2 = num / Mathf.Clamp(gunBPS / 2f - 0.5f, 0.75f, 50f) * component3.health;
						component3.healthHandler.RPCA_SendTakeDamage(new Vector2(num2, 0f), Vector2.op_Implicit(((Component)this).transform.position), true, component.player.playerID);
					}
					return (HasToReturn)1;
				}
				return (HasToReturn)1;
			}
			return (HasToReturn)1;
		}

		public void Destroy()
		{
		}
	}
	public class ChompyBulletPetiteModifier : RayHitEffect
	{
		private const float healthCullBaseFactor = 0.9f;

		private float healthCullPercentage;

		public override HasToReturn DoHitEffect(HitInfo hit)
		{
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)hit.transform == (Object)null))
			{
				if (!((Component)hit.transform).gameObject.tag.Contains("Bullet"))
				{
					if (Object.op_Implicit((Object)(object)((Component)hit.transform).GetComponent<Player>()))
					{
						ProjectileHit componentInParent = ((Component)this).gameObject.GetComponentInParent<ProjectileHit>();
						Player ownPlayer = componentInParent.ownPlayer;
						Gun component = componentInParent.ownWeapon.GetComponent<Gun>();
						CharacterStatModifiers component2 = ((Component)ownPlayer).gameObject.GetComponent<CharacterStatModifiers>();
						healthCullPercentage = Mathf.Pow(0.9f, (float)component2.GetGearData().chompyBulletStack);
						float num = 1f - healthCullPercentage;
						CharacterData component3 = ((Component)hit.transform).gameObject.GetComponent<CharacterData>();
						float num2 = num * component3.health;
						component3.healthHandler.RPCA_SendTakeDamage(new Vector2(num2, 0f), Vector2.op_Implicit(((Component)this).transform.position), true, component.player.playerID);
					}
					return (HasToReturn)1;
				}
				return (HasToReturn)1;
			}
			return (HasToReturn)1;
		}

		public void Destroy()
		{
		}
	}
	internal class CustomEmpowerShotModifier : RayHitEffect
	{
		public static float procTickTime = 0.05f;

		public static string RPCKey = "com.pudassassin.rounds.GearUpCards:CEmpowerImpactSync";

		public PhotonView view;

		private int empowerImpactCount = 1;

		private int empowerStackCount = 1;

		private float empowerBurstDelay = 0.1f;

		private Vector2 lastImpactPos;

		internal bool effectEnable;

		internal float procTimer;

		internal Vector3 prevBulletPos = Vector3.zero;

		private void Awake()
		{
			view = ((Component)this).GetComponentInParent<PhotonView>();
			((Component)this).GetComponentInParent<ChildRPC>().childRPCsVector2.Add(RPCKey, (Action<Vector2>)SyncImpactPos);
		}

		public void SetupEmpowerCharge(int impact, int stack, float burstDelay = 0.1f)
		{
			empowerImpactCount = impact;
			empowerStackCount = stack;
			empowerBurstDelay = burstDelay;
		}

		public void SyncImpactPos(Vector2 pos)
		{
			//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_0007: Unknown result type (might be due to invalid IL or missing references)
			prevBulletPos = Vector2.op_Implicit(pos);
		}

		public void Update()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			if (effectEnable)
			{
				procTimer += TimeHandler.deltaTime;
				if (procTimer >= procTickTime)
				{
					prevBulletPos = ((Component)this).transform.root.position;
					procTimer -= procTickTime;
				}
			}
			else if ((Object)(object)((Component)this).GetComponentInParent<MoveTransform>() != (Object)null)
			{
				effectEnable = true;
			}
		}

		public override HasToReturn DoHitEffect(HitInfo hit)
		{
			//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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)view != (Object)null && view.IsMine)
			{
				((Component)this).GetComponentInParent<ChildRPC>().CallFunction(RPCKey, Vector2.op_Implicit(prevBulletPos));
			}
			if (empowerImpactCount > 0)
			{
				lastImpactPos = Vector2.op_Implicit(prevBulletPos);
				if (lastImpactPos == Vector2.zero)
				{
					lastImpactPos = hit.point;
				}
				for (int i = 0; i < empowerStackCount; i++)
				{
					if (i == 0)
					{
						((Component)this).GetComponentInParent<SpawnedAttack>().spawner.data.block.DoBlockAtPosition(true, true, (BlockTriggerType)4, Vector2.op_Implicit(lastImpactPos - Vector2.op_Implicit(((Component)this).transform.forward) * 0.05f), true);
						continue;
					}
					ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)this, empowerBurstDelay * (float)i, (Action)([CompilerGenerated] () =>
					{
						//IL_0019: Unknown result type (might be due to invalid IL or missing references)
						//IL_0024: Unknown result type (might be due to invalid IL or missing references)
						//IL_0029: Unknown result type (might be due to invalid IL or missing references)
						//IL_0033: Unknown result type (might be due to invalid IL or missing references)
						//IL_0038: Unknown result type (might be due to invalid IL or missing references)
						//IL_003d: Unknown result type (might be due to invalid IL or missing references)
						((Component)this).GetComponentInParent<SpawnedAttack>().spawner.data.block.DoBlockAtPosition(true, true, (BlockTriggerType)4, Vector2.op_Implicit(lastImpactPos - Vector2.op_Implicit(((Component)this).transform.forward) * 0.05f), true);
					}));
				}
				empowerImpactCount--;
				return (HasToReturn)1;
			}
			return (HasToReturn)1;
		}

		private void OnDestroy()
		{
			((Component)this).GetComponentInParent<ChildRPC>()?.childRPCsVector2.Remove(RPCKey);
		}
	}
	public class CustomEmpowerVFX : MonoBehaviour
	{
		private static GameObject empowerShotVFX = GearUpCards.VFXBundle.LoadAsset<GameObject>("VFX_EmpowerShot");

		public static float vfxScale = 0.25f;

		public static float vfxScaleLog = 10f;

		private ProjectileHit projectileHit;

		private Player shooterPlayer;

		private GameObject vfxObject;

		private float bulletSize = 0.25f;

		private float damage;

		internal bool effectEnable;

		public void Setup()
		{
			//IL_0057: 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)
			projectileHit = ((Component)this).gameObject.GetComponentInParent<ProjectileHit>();
			shooterPlayer = projectileHit.ownPlayer;
			vfxObject = Object.Instantiate<GameObject>(empowerShotVFX, ((Component)this).transform.root);
			vfxObject.transform.localEulerAngles = new Vector3(270f, 180f, 0f);
			vfxObject.transform.localScale = Vector3.one * bulletSize;
		}

		public void Update()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			if (effectEnable)
			{
				damage = projectileHit.dealDamageMultiplierr * projectileHit.damage;
				bulletSize = Mathf.Max(Mathf.Log(damage, vfxScaleLog) * vfxScale, 0.5f);
				vfxObject.transform.localScale = Vector3.one * bulletSize;
			}
			else if ((Object)(object)((Component)this).GetComponentInParent<MoveTransform>() != (Object)null)
			{
				Setup();
				effectEnable = true;
			}
		}
	}
	public class MysticMissileModifier : RayHitEffect
	{
		private static float seekAngleBase = 120f;

		private static float seekAngleScaling = 30f;

		private static float turnSpeedBase = 210f;

		private static float turnSpeedScaling = 30f;

		private static float accelBase = 40f;

		private static float accelScaling = 10f;

		private static float homingSpeedBase = 40f;

		private static float homingSpeedScaling = 10f;

		private static float homingRangeBase = 30f;

		private static float homingRangeScaling = 5f;

		private static float explosionForceBase = 9000f;

		private static float explosionForceScaling = 4500f;

		private static float explosionRadiusBase = 4.5f;

		private static float explosionRadiusScaling = 1.5f;

		private static float damageFactorBase = 0.45f;

		private static float damageFactorScaling = 0.15f;

		private static float bouncePowerMulBase = 0.6f;

		private static float bouncePowerMulScaling = 0.05f;

		private static float powerLevelMin = 0.1f;

		private static float logBaseProj = 5f;

		private static float dmgDiv = 25f;

		private static float trailScale = 0.75f;

		private static float procTime = 0.05f;

		private MoveTransform bulletMove;

		private RayHitReflect rayHitReflect;

		private ProjectileHit projectileHit;

		private Explosion explosionImpact;

		private SyncBulletPosition syncMono;

		private Miscs.SetColorToParticles partColor;

		private Miscs.SetColorToParticles partColorExp;

		private Player shooterPlayer;

		private Gun shooterGun;

		private CharacterStatModifiers shooterStats;

		private int stackCount;

		private int glyphGeometric;

		private int glyphInfluence;

		private int glyphPotency;

		private int glyphDivination;

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

		private Player homingTarget;

		private bool seeEnemy;

		private float targetEnemyDistance;

		private float seekAngle;

		private float turnSpeed;

		private float acceleration;

		private float homingSpeed;

		private float homingRange;

		private float bouncePowerFactor = 0.5f;

		private float currentPower = 1f;

		private float prevGravity;

		private float tickTimer;

		private int bounceCount;

		private int bounceFromPlayer;

		private bool dieNextHit;

		private Vector3 moveVelocity;

		private Vector3 vecToTarget;

		private bool effectEnable;

		public void Update()
		{
			//IL_04dd: Expected O, but got Unknown
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)