Decompiled source of AALUND13 Cards Beta v2.0.18

plugins/AALUND13_Armors_Cards.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AALUND13Cards.Armors.Armors;
using AALUND13Cards.Armors.Armors.Processors;
using AALUND13Cards.Armors.Cards;
using AALUND13Cards.Armors.Utils;
using AALUND13Cards.Core;
using AALUND13Cards.Core.Cards;
using AALUND13Cards.Core.Cards.Conditions;
using AALUND13Cards.Core.Extensions;
using AALUND13Cards.Core.Utils;
using BepInEx;
using HarmonyLib;
using JARL.Armor;
using JARL.Armor.Bases;
using JARL.Armor.Builtin;
using JARL.Armor.Processors;
using JARL.Armor.Utlis;
using JARL.Extensions;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using TabInfo.Utils;
using UnboundLib;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[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]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AALUND13Cards.Armors
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("AALUND13.Cards.Armors", "AALUND13 Armors Cards", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	internal class AAC_Armors : BaseUnityPlugin
	{
		internal const string ModId = "AALUND13.Cards.Armors";

		internal const string ModName = "AALUND13 Armors Cards";

		internal const string Version = "1.0.0";

		private static AssetBundle assets;

		private void Awake()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			assets = AssetUtils.LoadAssetBundleFromResources("aac_armors_assets", typeof(AAC_Armors).Assembly);
			if ((Object)(object)assets != (Object)null)
			{
				new Harmony("AALUND13.Cards.Armors").PatchAll();
			}
		}

		private void Start()
		{
			if ((Object)(object)assets == (Object)null)
			{
				Unbound.BuildModal("AALUND13 Cards Error", "The mod \"AALUND13 Armors Cards\" assets failled to load, All the cards will be disable in this mod");
				throw new NullReferenceException("Failled to load \"AALUND13 Armors Cards\" assets");
			}
			ArmorTypeGetterUtils.RegiterArmorType<TitaniumArmor>("Titanium");
			ArmorTypeGetterUtils.RegiterArmorType<BattleforgedArmor>("Battleforged");
			ArmorFramework.RegisterArmorProcessor<DamageAgainstArmorPercentageProcessor>();
			ArmorFramework.RegisterArmorProcessor<ArmorDamageReductionProcessor>();
			assets.LoadAsset<GameObject>("ArmorsModCards").GetComponent<CardResgester>().RegisterCards();
			if (AAC_Core.Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "com.willuwontu.rounds.tabinfo"))
			{
				TabinfoInterface.Setup();
			}
		}
	}
	internal class TabinfoInterface
	{
		public static void Setup()
		{
			StatCategory orCreateCategory = TabinfoInterface.GetOrCreateCategory("AA Stats", 6);
			TabInfoManager.RegisterStat(orCreateCategory, "Damage Against Armor Percentage", (Func<Player, bool>)((Player p) => GetArmorStatsFromPlayer(p).DamageAgainstArmorPercentage != 1f), (Func<Player, string>)((Player p) => $"{GetArmorStatsFromPlayer(p).DamageAgainstArmorPercentage * 100f:0}%"));
			TabInfoManager.RegisterStat(orCreateCategory, "Armor Damage Reduction", (Func<Player, bool>)((Player p) => GetArmorStatsFromPlayer(p).ArmorDamageReduction != 0f), (Func<Player, string>)((Player p) => $"{GetArmorStatsFromPlayer(p).ArmorDamageReduction * 100f:0}%"));
		}

		private static ArmorStats GetArmorStatsFromPlayer(Player player)
		{
			return CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<ArmorStats>();
		}
	}
}
namespace AALUND13Cards.Armors.Utils
{
	public class ArmorTypeGetterUtils
	{
		private static Dictionary<string, Type> registerArmorType = new Dictionary<string, Type>();

		public static ReadOnlyDictionary<string, Type> RegisterArmorType => new ReadOnlyDictionary<string, Type>(RegisterArmorType);

		public static void RegiterArmorType<T>(string armorId) where T : ArmorBase, new()
		{
			if (registerArmorType.ContainsKey(armorId))
			{
				throw new ArgumentException("Armor with the type '" + armorId + "' already register");
			}
			ArmorFramework.RegisterArmorType<T>();
			registerArmorType.Add(armorId, typeof(T));
		}

		public static Type GetArmorType(string armorId)
		{
			return registerArmorType[armorId];
		}
	}
}
namespace AALUND13Cards.Armors.CardsEffects
{
	public class RestorationMono : MonoBehaviour
	{
		public float MnRegenCooldown;

		private bool isActive;

		private float regenAmount;

		private CharacterData data;

		private ArmorHandler armorHandler;

		private void Start()
		{
			data = ((Component)this).GetComponentInParent<CharacterData>();
			armorHandler = ((Component)this).GetComponentInParent<ArmorHandler>();
		}

		private void Update()
		{
			if (!isActive && data.health >= data.maxHealth)
			{
				regenAmount = data.healthHandler.regeneration;
				AddRegenerationAmountToAllArmors(regenAmount);
				isActive = true;
			}
			else if (isActive && data.health >= data.maxHealth && regenAmount != data.healthHandler.regeneration)
			{
				AddRegenerationAmountToAllArmors(0f - regenAmount);
				regenAmount = data.healthHandler.regeneration;
				AddRegenerationAmountToAllArmors(regenAmount);
			}
			else if (isActive && data.health < data.maxHealth)
			{
				AddRegenerationAmountToAllArmors(0f - regenAmount);
				isActive = false;
			}
		}

		private void AddRegenerationAmountToAllArmors(float regenerationAmount)
		{
			foreach (ArmorBase activeArmor in armorHandler.ActiveArmors)
			{
				if (!activeArmor.HasArmorTag("NoRestorationRegen"))
				{
					if (activeArmor.ArmorRegenCooldownSeconds < MnRegenCooldown)
					{
						activeArmor.ArmorRegenCooldownSeconds = MnRegenCooldown;
					}
					activeArmor.ArmorRegenerationRate += regenerationAmount;
				}
			}
		}
	}
}
namespace AALUND13Cards.Armors.MonoBehaviours.CardsEffects
{
	public class HealthToArmorConversion : MonoBehaviour
	{
		public float HealthToArmorConversions = 0.5f;

		private Dictionary<ArmorBase, float> armorAdded = new Dictionary<ArmorBase, float>();

		private CharacterData characterData;

		private ArmorHandler armorHandler;

		private float oldHealth;

		private int oldArmorCount;

		private void Start()
		{
			characterData = ((Component)this).GetComponentInParent<CharacterData>();
			armorHandler = ((Component)this).GetComponentInParent<ArmorHandler>();
			CharacterData obj = characterData;
			obj.maxHealth *= HealthToArmorConversions;
			CharacterData obj2 = characterData;
			obj2.health *= HealthToArmorConversions;
			oldHealth = characterData.maxHealth;
			oldArmorCount = Mathf.Max(armorHandler.ActiveArmors.Count, 1);
			UpdateArmorStats();
		}

		private void Update()
		{
			if (characterData.maxHealth != oldHealth || armorHandler.ActiveArmors.Count != oldArmorCount)
			{
				oldHealth = characterData.maxHealth;
				oldArmorCount = Mathf.Max(armorHandler.ActiveArmors.Count, 1);
				UpdateArmorStats();
			}
		}

		private void OnDestroy()
		{
			foreach (KeyValuePair<ArmorBase, float> item in armorAdded)
			{
				ArmorBase key = item.Key;
				key.MaxArmorValue -= item.Value;
				ArmorBase key2 = item.Key;
				key2.CurrentArmorValue -= item.Value;
			}
		}

		private void UpdateArmorStats()
		{
			Dictionary<ArmorBase, float> dictionary = new Dictionary<ArmorBase, float>(armorAdded);
			foreach (KeyValuePair<ArmorBase, float> item in armorAdded)
			{
				ArmorBase key = item.Key;
				key.MaxArmorValue -= item.Value;
			}
			armorAdded.Clear();
			if (armorHandler.ActiveArmors.Count == 0)
			{
				float num = characterData.maxHealth * HealthToArmorConversions * 2f;
				ArmorBase armorByType = armorHandler.GetArmorByType<DefaultArmor>();
				float num2 = num;
				if (dictionary.ContainsKey(armorByType))
				{
					num2 = num - dictionary[armorByType];
				}
				armorByType.MaxArmorValue += num;
				armorByType.CurrentArmorValue += num2;
				armorAdded[armorByType] = num;
			}
			else
			{
				float num3 = characterData.maxHealth * HealthToArmorConversions * 2f / (float)armorHandler.ActiveArmors.Count;
				foreach (ArmorBase activeArmor in armorHandler.ActiveArmors)
				{
					float num4 = num3;
					if (dictionary.ContainsKey(activeArmor))
					{
						num4 = num3 - dictionary[activeArmor];
					}
					activeArmor.MaxArmorValue += num3;
					activeArmor.CurrentArmorValue += num4;
					armorAdded[activeArmor] = num3;
				}
			}
			LoggerUtils.LogInfo($"Added armors to player with a id of {characterData.player.playerID}");
		}
	}
}
namespace AALUND13Cards.Armors.Cards
{
	public class ArmorStats : ICustomStats
	{
		public float DamageAgainstArmorPercentage = 1f;

		public float ArmorDamageReduction;

		public void ResetStats()
		{
			DamageAgainstArmorPercentage = 1f;
			ArmorDamageReduction = 0f;
		}
	}
}
namespace AALUND13Cards.Armors.Cards.StatModifers
{
	public class ArmorStatModifers : CustomStatModifers
	{
		[Header("Armors Stats")]
		public float ArmorDamageReduction;

		[Space(10f)]
		public string ArmorTypeId = "";

		public float ArmorHealth;

		public float ArmorHealthMultiplier = 1f;

		public float ArmorRegenRate;

		public float ArmorRegenCooldown;

		public bool RemoveArmorPirceTag;

		[Space(10f)]
		public bool OverrideArmorDamagePatchType;

		public bool PatchDoDamage;

		public bool PatchTakeDamage;

		public bool PatchTakeDamageOverTime;

		[Space(10f)]
		public ArmorReactivateType ArmorReactivateType;

		public float ArmorReactivateValue;

		[Header("Armor Pierce Stats")]
		public float ArmorPiercePercent;

		public float DamageAgainstArmorPercentage = 1f;

		public override void Apply(Player player)
		{
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: 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_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			ArmorStats orCreate = CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<ArmorStats>();
			JARLCharacterDataAdditionalData additionalData = CharacterDataExtensions.GetAdditionalData(player.data);
			orCreate.ArmorDamageReduction = Mathf.Min(orCreate.ArmorDamageReduction + ArmorDamageReduction, 0.8f);
			if (!Utility.IsNullOrWhiteSpace(ArmorTypeId))
			{
				ArmorBase val = ArmorFramework.ArmorHandlers[player].Armors.First((ArmorBase x) => ((object)x).GetType() == ArmorTypeGetterUtils.GetArmorType(ArmorTypeId));
				if (val != null)
				{
					val.MaxArmorValue += ArmorHealth;
					if (AAC_Core.Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "Systems.R00t.AdditiveStats"))
					{
						val.MaxArmorValue += 100f * (ArmorHealthMultiplier - 1f);
					}
					else
					{
						val.MaxArmorValue *= ArmorHealthMultiplier;
					}
					val.ArmorRegenerationRate += ArmorRegenRate;
					val.ArmorRegenCooldownSeconds += ArmorRegenCooldown;
					if (ArmorReactivateValue > 0f)
					{
						val.reactivateArmorType = ArmorReactivateType;
						val.reactivateArmorValue = ArmorReactivateValue;
					}
					if (RemoveArmorPirceTag && val.HasArmorTag("CanArmorPierce"))
					{
						val.ArmorTags.Remove("CanArmorPierce");
					}
					if (OverrideArmorDamagePatchType)
					{
						val.ArmorDamagePatch = (ArmorDamagePatchType)0;
						if (PatchDoDamage)
						{
							val.ArmorDamagePatch = (ArmorDamagePatchType)(val.ArmorDamagePatch | 1);
						}
						if (PatchTakeDamage)
						{
							val.ArmorDamagePatch = (ArmorDamagePatchType)(val.ArmorDamagePatch | 2);
						}
						if (PatchTakeDamageOverTime)
						{
							val.ArmorDamagePatch = (ArmorDamagePatchType)(val.ArmorDamagePatch | 4);
						}
					}
				}
			}
			additionalData.ArmorPiercePercent = Mathf.Clamp(additionalData.ArmorPiercePercent + ArmorPiercePercent, 0f, 1f);
			orCreate.DamageAgainstArmorPercentage += DamageAgainstArmorPercentage - 1f;
		}
	}
}
namespace AALUND13Cards.Armors.Cards.Conditions
{
	public class PlayerHaveArmorCondition : CardCondition
	{
		public List<string> BlacklistedArmorTag = new List<string>();

		public override bool IsPlayerAllowedCard(Player player)
		{
			return ArmorFramework.ArmorHandlers[player].ActiveArmors.Any((ArmorBase armor) => !BlacklistedArmorTag.Any((string tag) => armor.ArmorTags.Contains(tag)));
		}
	}
}
namespace AALUND13Cards.Armors.Armors
{
	public class BattleforgedArmor : ArmorBase
	{
		public override BarColor GetBarColor()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//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)
			return new BarColor(Color.yellow * 0.6f, Color.yellow * 0.45f);
		}

		public override DamageArmorInfo OnDamage(float damage, Player DamagingPlayer, ArmorDamagePatchType? armorDamagePatchType)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			DamageArmorInfo val = ArmorUtils.ApplyDamage(base.CurrentArmorValue, damage);
			float num = base.CurrentArmorValue - val.Armor;
			base.MaxArmorValue += num * 0.1f;
			return val;
		}

		public BattleforgedArmor()
		{
			base.ArmorTags.Add("CanArmorPierce");
			base.ArmorRegenCooldownSeconds = 5f;
		}
	}
	public class TitaniumArmor : ArmorBase
	{
		public int SegmentsCount = 4;

		public float RegenThresholdPercent = 1.5f;

		private float segmentThresholdHealth;

		private Image segmentThresholdBar;

		public TitaniumArmor()
		{
			base.ArmorTags.Add("CanArmorPierce");
			base.ArmorRegenCooldownSeconds = 5f;
		}

		public override BarColor GetBarColor()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//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)
			return new BarColor(Color.magenta * 0.6f, Color.magenta * 0.45f);
		}

		public override void OnUpdate()
		{
			TryCreateArmorMinBar();
			float num = base.MaxArmorValue / (float)SegmentsCount;
			while (base.CurrentArmorValue >= segmentThresholdHealth + num * RegenThresholdPercent)
			{
				segmentThresholdHealth += num;
			}
			if ((Object)(object)segmentThresholdBar != (Object)null)
			{
				segmentThresholdBar.fillAmount = segmentThresholdHealth / base.MaxArmorValue;
			}
		}

		public override void OnRespawn()
		{
			segmentThresholdHealth = base.MaxArmorValue - base.MaxArmorValue / (float)SegmentsCount;
		}

		public override DamageArmorInfo OnDamage(float damage, Player DamagingPlayer, ArmorDamagePatchType? armorDamagePatchType)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			DamageArmorInfo val = ((ArmorBase)this).OnDamage(damage, DamagingPlayer, armorDamagePatchType);
			if (Mathf.Max(val.Armor, segmentThresholdHealth) <= segmentThresholdHealth + 0.1f && segmentThresholdHealth > 0f)
			{
				((DamageArmorInfo)(ref val))..ctor(0f, segmentThresholdHealth);
				segmentThresholdHealth = Mathf.Max(segmentThresholdHealth - base.MaxArmorValue / (float)SegmentsCount, 0f);
			}
			return val;
		}

		private void TryCreateArmorMinBar()
		{
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)segmentThresholdBar != (Object)null)
			{
				return;
			}
			Dictionary<ArmorBase, GameObject> dictionary = (Dictionary<ArmorBase, GameObject>)ExtensionMethods.GetFieldValue((object)((ArmorBase)this).ArmorHandler, "armorHealthBars");
			if (dictionary == null || !dictionary.ContainsKey((ArmorBase)(object)this))
			{
				return;
			}
			GameObject gameObject = ((Component)dictionary[(ArmorBase)(object)this].transform.Find("Healthbar(Clone)/Canvas/Image")).gameObject;
			if ((Object)(object)gameObject.transform.Find("MinArmorBar") == (Object)null)
			{
				gameObject.AddComponent<Mask>();
				GameObject obj = Object.Instantiate<GameObject>(((Component)gameObject.transform.Find("Health")).gameObject, gameObject.transform);
				((Object)obj).name = "MinArmorBar";
				obj.transform.SetAsLastSibling();
				Image component = obj.GetComponent<Image>();
				((Graphic)component).color = new Color(0.45f, 0f, 0.45f, 1f);
				component.fillAmount = segmentThresholdHealth / base.MaxArmorValue;
				segmentThresholdBar = component;
				GameObject gameObject2 = ((Component)gameObject.transform.Find("Grid")).gameObject;
				gameObject2.transform.SetAsLastSibling();
				((HorizontalOrVerticalLayoutGroup)gameObject2.GetComponent<HorizontalLayoutGroup>()).spacing = -10f;
				GameObject[] array = (GameObject[])(object)new GameObject[gameObject2.transform.childCount];
				for (int i = 0; i < gameObject2.transform.childCount; i++)
				{
					array[i] = ((Component)gameObject2.transform.GetChild(i)).gameObject;
				}
				int num = 8 - SegmentsCount;
				for (int j = 0; j < num; j++)
				{
					array[j].SetActive(false);
				}
				gameObject2.SetActive(true);
			}
			else
			{
				segmentThresholdBar = ((Component)gameObject.transform.Find("MinArmorBar")).GetComponent<Image>();
				segmentThresholdBar.fillAmount = segmentThresholdHealth / base.MaxArmorValue;
			}
		}
	}
}
namespace AALUND13Cards.Armors.Armors.Processors
{
	public class ArmorDamageReductionProcessor : ArmorProcessor
	{
		public override float BeforeArmorProcess(float remaindingDamage, float originalDamage)
		{
			if (!((ArmorProcessor)this).Armor.HasArmorTag("NoDamageReduction"))
			{
				if (CharacterDataExtensions.GetCustomStatsRegistry(((ArmorProcessor)this).HurtPlayer.data).GetOrCreate<ArmorStats>().ArmorDamageReduction == 0f)
				{
					return remaindingDamage;
				}
				return remaindingDamage * (1f - CharacterDataExtensions.GetCustomStatsRegistry(((ArmorProcessor)this).HurtPlayer.data).GetOrCreate<ArmorStats>().ArmorDamageReduction);
			}
			return remaindingDamage;
		}
	}
	internal class DamageAgainstArmorPercentageProcessor : ArmorProcessor
	{
		public override float AfterArmorProcess(float remaindingDamage, float originalDamage, float takenArmorDamage)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			if (((ArmorProcessor)this).Armor.HasArmorTag("CanArmorPierce"))
			{
				if ((Object)(object)((ArmorProcessor)this).DamagingPlayer == (Object)null || CharacterDataExtensions.GetCustomStatsRegistry(((ArmorProcessor)this).DamagingPlayer.data).GetOrCreate<ArmorStats>().DamageAgainstArmorPercentage == 1f || takenArmorDamage <= 0f)
				{
					return remaindingDamage;
				}
				DamageArmorInfo val = ((ArmorProcessor)this).Armor.OnDamage(takenArmorDamage * (CharacterDataExtensions.GetCustomStatsRegistry(((ArmorProcessor)this).DamagingPlayer.data).GetOrCreate<ArmorStats>().DamageAgainstArmorPercentage - 1f), ((ArmorProcessor)this).DamagingPlayer, (ArmorDamagePatchType?)((ArmorProcessor)this).ArmorDamagePatchType);
				((ArmorProcessor)this).Armor.CurrentArmorValue = val.Armor;
			}
			return remaindingDamage;
		}
	}
}

plugins/AALUND13_Cards_Core.dll

Decompiled 3 days 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 System.Security;
using System.Security.Permissions;
using AALUND13Cards.Core.Cards;
using AALUND13Cards.Core.Cards.Conditions;
using AALUND13Cards.Core.Cards.Effects;
using AALUND13Cards.Core.Extensions;
using AALUND13Cards.Core.Handlers;
using AALUND13Cards.Core.Utils;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using HarmonyLib;
using JARL.Bases;
using JARL.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.GameModes;
using ModdingUtils.Utils;
using ModsPlus;
using Photon.Pun;
using RarityLib.Utils;
using Sonigon;
using TMPro;
using TabInfo.Utils;
using ToggleCardsCategories;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.Utils;
using UnboundLib.Utils.UI;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using WillsWackyManagers.Utils;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AALUND13Cards.Core
{
	[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.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("AALUND13.Cards.Core", "AALUND13 Cards Core", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	public class AAC_Core : BaseUnityPlugin
	{
		public const string ModInitials = "AAC";

		internal const string ModId = "AALUND13.Cards.Core";

		internal const string ModName = "AALUND13 Cards Core";

		internal const string Version = "1.0.0";

		public static List<BaseUnityPlugin> Plugins;

		internal static ManualLogSource ModLogger;

		public static CardResgester CardMainResgester;

		public static CardCategory[] NoLotteryCategories;

		public static CardCategory[] NoSteelCategories;

		public static AAC_Core Instance { get; private set; }

		public void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			ModLogger = ((BaseUnityPlugin)this).Logger;
			new Harmony("AALUND13.Cards.Core").PatchAll();
			ToggleCardsCategoriesManager.instance.RegisterCategories("AAC");
			ConfigHandler.RegesterMenu(((BaseUnityPlugin)this).Config);
		}

		public void Start()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			Plugins = (List<BaseUnityPlugin>)typeof(Chainloader).GetField("_plugins", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
			DeathHandler.OnPlayerDeath += new DeathHandlerDelegate(OnPlayerDeath);
			if (Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "com.willuwontu.rounds.tabinfo"))
			{
				TabinfoInterface.Setup();
			}
			((Component)this).gameObject.AddComponent<DelayDamageHandler>();
			((Component)this).gameObject.AddComponent<PickCardTracker>();
			((Component)this).gameObject.AddComponent<DamageEventHandler>();
			((Component)this).gameObject.AddComponent<ConstantDamageHandler>();
			NoLotteryCategories = (CardCategory[])(object)new CardCategory[2]
			{
				CustomCardCategories.instance.CardCategory("CardManipulation"),
				CustomCardCategories.instance.CardCategory("NoRandom")
			};
			NoSteelCategories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("NoRemove") };
		}

		private void OnPlayerDeath(Player player, Dictionary<Player, DamageInfo> playerDamageInfos)
		{
			if ((Object)(object)((Component)player).GetComponent<DelayDamageHandler>() != (Object)null)
			{
				((MonoBehaviour)((Component)player).GetComponent<DelayDamageHandler>()).StopAllCoroutines();
			}
		}
	}
	public class TabinfoInterface
	{
		public static StatCategory GetOrCreateCategory(string name, int priority)
		{
			if (!TabInfoManager.Categories.ContainsKey(name.ToLower()))
			{
				return TabInfoManager.RegisterCategory(name, 6);
			}
			return TabInfoManager.Categories[name.ToLower()];
		}

		internal static void Setup()
		{
			StatCategory orCreateCategory = GetOrCreateCategory("AA Stats", 6);
			TabInfoManager.RegisterStat(orCreateCategory, "Block Pierce Percent", (Func<Player, bool>)((Player p) => p.data.GetAdditionalData().BlockPircePercent != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().BlockPircePercent * 100f:0}%"));
			TabInfoManager.RegisterStat(orCreateCategory, "Damage Per Seconds", (Func<Player, bool>)((Player _) => true), (Func<Player, string>)((Player p) => $"{p.GetDPS()}"));
			TabInfoManager.RegisterStat(orCreateCategory, "Bullets Per Seconds", (Func<Player, bool>)((Player _) => true), (Func<Player, string>)((Player p) => $"{p.GetSPS()}"));
		}
	}
	public static class LoggerUtils
	{
		public static bool logging = ConfigHandler.DebugMode.Value;

		public static void LogInfo(string message)
		{
			if (logging)
			{
				AAC_Core.ModLogger.LogInfo((object)message);
			}
		}

		public static void LogWarn(string message)
		{
			AAC_Core.ModLogger.LogWarning((object)message);
		}

		public static void LogError(string message)
		{
			AAC_Core.ModLogger.LogError((object)message);
		}
	}
}
namespace AALUND13Cards.Core.VisualEffect
{
	public class AddAComponentToRandomObjects : MonoBehaviour
	{
		public int NumberOfObjectsToAdd = 1;

		public MonoBehaviour ComponentToAdd;

		public List<GameObject> TargetObjects;

		private void Start()
		{
			if (TargetObjects == null || TargetObjects.Count == 0)
			{
				Debug.LogWarning("No TargetObjects specified to add the component to.");
				return;
			}
			for (int i = 0; i < NumberOfObjectsToAdd; i++)
			{
				AddComponentToRandomObject();
			}
		}

		private void AddComponentToRandomObject()
		{
			if (TargetObjects == null || TargetObjects.Count == 0)
			{
				Debug.LogWarning("No TargetObjects specified to add the component to.");
				return;
			}
			int index = Random.Range(0, TargetObjects.Count);
			GameObject val = TargetObjects[index];
			if ((Object)(object)val.GetComponent(((object)ComponentToAdd).GetType()) != (Object)null)
			{
				Debug.LogWarning("Component " + ((object)ComponentToAdd).GetType().Name + " already exists on " + ((Object)val).name);
				return;
			}
			val.AddComponent(((object)ComponentToAdd).GetType());
			TargetObjects.RemoveAt(index);
		}
	}
	public class AddRandomCardArt : MonoBehaviour
	{
		public bool AddRandomArtAtStart = true;

		public bool AddRandomArtAtEnable;

		public GameObject ArtParent;

		private void Start()
		{
			if (AddRandomArtAtStart)
			{
				GenerateRandomArt();
			}
		}

		private void OnEnable()
		{
			if (AddRandomArtAtEnable)
			{
				GenerateRandomArt();
			}
		}

		private void OnDisable()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			foreach (Transform item in ArtParent.transform)
			{
				Object.Destroy((Object)(object)((Component)item).gameObject);
			}
		}

		public void GenerateRandomArt()
		{
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			if (Application.isEditor)
			{
				Debug.LogWarning((object)"Random Card Art cannot be generated in editor mode.");
				return;
			}
			CardInfo[] array = (from c in CardManager.cards
				where (Object)(object)c.Value.cardInfo.cardArt != (Object)null
				select c.Value.cardInfo).ToArray();
			if (array.Length != 0)
			{
				GameObject obj = Object.Instantiate<GameObject>(array[Random.Range(0, array.Length)].cardArt, ArtParent.transform);
				obj.transform.localScale = Vector3.one;
				obj.transform.localPosition = Vector3.zero;
			}
		}
	}
	public class StartWithRandomRotationOffset : MonoBehaviour
	{
		[Tooltip("The maximum rotation offset in degrees that will be applied to the object at start.")]
		public float rotationOffset = 25f;

		private void Start()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			float num = Random.Range(0f - rotationOffset, rotationOffset);
			Quaternion rotation = ((Component)this).transform.rotation;
			Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
			eulerAngles.z += num;
			((Component)this).transform.rotation = Quaternion.Euler(eulerAngles);
		}
	}
	[DisallowMultipleComponent]
	public class StartWithRandomSize : MonoBehaviour
	{
		public Vector2 sizeRange = new Vector2(0.75f, 1.25f);

		private void Start()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			float num = Random.Range(sizeRange.x, sizeRange.y);
			((Component)this).transform.localScale = new Vector3(num, num, 1f);
		}
	}
	[ExecuteAlways]
	[RequireComponent(typeof(RectTransform))]
	public class StretchImageBetween : MonoBehaviour
	{
		public RectTransform pointA;

		public RectTransform pointB;

		private RectTransform rectTransform;

		private void Awake()
		{
			rectTransform = ((Component)this).GetComponent<RectTransform>();
		}

		private void Update()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)pointA == (Object)null) && !((Object)(object)pointB == (Object)null))
			{
				Vector3 val = ((Transform)rectTransform).parent.InverseTransformPoint(((Transform)pointA).position);
				Vector3 val2 = ((Transform)rectTransform).parent.InverseTransformPoint(((Transform)pointB).position);
				Vector3 localPosition = (val + val2) / 2f;
				((Transform)rectTransform).localPosition = localPosition;
				Vector3 val3 = val2 - val;
				float num = Mathf.Atan2(val3.y, val3.x) * 57.29578f;
				((Transform)rectTransform).localRotation = Quaternion.Euler(0f, 0f, num);
				float num2 = ((Vector3)(ref val3)).magnitude / ((Transform)rectTransform).localScale.x;
				rectTransform.sizeDelta = new Vector2(num2, rectTransform.sizeDelta.y);
			}
		}
	}
}
namespace AALUND13Cards.Core.Utils
{
	public interface ICustomStats
	{
		void ResetStats();
	}
	public class CustomStatsRegistry : IEnumerable<ICustomStats>, IEnumerable
	{
		private readonly Dictionary<Type, ICustomStats> statsMap = new Dictionary<Type, ICustomStats>();

		public bool Exist<T>() where T : ICustomStats
		{
			return statsMap.ContainsKey(typeof(T));
		}

		public T Get<T>() where T : ICustomStats
		{
			return (T)statsMap[typeof(T)];
		}

		public T Add<T>(T customStatsHandler) where T : ICustomStats
		{
			if (Exist<T>())
			{
				throw new ArgumentException("Item '" + typeof(T).FullName + "' already exists.", "customStatsHandler");
			}
			if (customStatsHandler == null)
			{
				throw new ArgumentNullException("customStatsHandler");
			}
			statsMap.Add(typeof(T), customStatsHandler);
			return customStatsHandler;
		}

		public T GetOrCreate<T>() where T : ICustomStats, new()
		{
			if (statsMap.TryGetValue(typeof(T), out var value))
			{
				return (T)value;
			}
			return Add(new T());
		}

		public void ResetAll()
		{
			foreach (ICustomStats value in statsMap.Values)
			{
				value.ResetStats();
			}
		}

		public IEnumerator<ICustomStats> GetEnumerator()
		{
			return statsMap.Values.GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}
	}
	public class PhotonPrefabPool : MonoBehaviour
	{
		public List<GameObject> Prefabs = new List<GameObject>();

		public void RegisterPrefabs()
		{
			foreach (GameObject prefab in Prefabs)
			{
				if ((Object)(object)prefab != (Object)null)
				{
					PhotonNetwork.PrefabPool.RegisterPrefab(((Object)prefab).name, prefab);
					LoggerUtils.LogInfo("Registered prefab: " + ((Object)prefab).name);
				}
			}
		}
	}
	public class PickCardTracker : MonoBehaviour, IPickStartHookHandler
	{
		public static PickCardTracker instance;

		private readonly List<CardInfo> cardPickedInPickPhase = new List<CardInfo>();

		public IReadOnlyList<CardInfo> CardPickedInPickPhase => cardPickedInPickPhase.AsReadOnly();

		public bool AlreadyPickedInPickPhase(CardInfo card)
		{
			if ((Object)(object)card == (Object)null)
			{
				return false;
			}
			return cardPickedInPickPhase.Contains(card);
		}

		public void OnPickStart()
		{
			cardPickedInPickPhase.Clear();
		}

		internal void AddCardPickedInPickPhase(CardInfo card)
		{
			if (!((Object)(object)card == (Object)null))
			{
				if ((Object)(object)card.sourceCard != (Object)null)
				{
					card = card.sourceCard;
				}
				if (!cardPickedInPickPhase.Contains(card))
				{
					cardPickedInPickPhase.Add(card);
				}
			}
		}

		private void Awake()
		{
			if ((Object)(object)instance != (Object)null)
			{
				Debug.LogWarning((object)"PickCardTracker instance already exists! Destroying the new one.");
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			else
			{
				instance = this;
				InterfaceGameModeHooksManager.instance.RegisterHooks((object)this);
			}
		}
	}
	public class RandomCardRarity : MonoBehaviour
	{
		public Image[] edges;

		public void OnEnable()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			if (!Application.isEditor)
			{
				Rarity randomRarity = GetRandomRarity();
				Image[] array = edges;
				for (int i = 0; i < array.Length; i++)
				{
					((Graphic)array[i]).color = randomRarity.color;
				}
			}
			else
			{
				Debug.Log((object)"RandomCardRarity is running in the editor");
			}
		}

		public static Rarity GetRandomRarity()
		{
			float num = RarityUtils.Rarities.Sum((KeyValuePair<int, Rarity> r) => r.Value.calculatedRarity);
			float num2 = Random.Range(0f, num);
			Rarity result = null;
			foreach (KeyValuePair<int, Rarity> rarity in RarityUtils.Rarities)
			{
				num2 -= rarity.Value.calculatedRarity;
				if (num2 <= 0f)
				{
					result = rarity.Value;
					break;
				}
			}
			return result;
		}
	}
}
namespace AALUND13Cards.Core.Patches
{
	[HarmonyPatch(typeof(Cards), "PlayerIsAllowedCard")]
	internal class AllowedCardPatch
	{
		private static void Postfix(Player player, CardInfo card, ref bool __result)
		{
			if ((Object)(object)player == (Object)null || (Object)(object)card == (Object)null)
			{
				return;
			}
			CardCondition[] components = ((Component)card).GetComponents<CardCondition>();
			if (components == null || components.Length == 0)
			{
				return;
			}
			CardCondition[] array = components;
			foreach (CardCondition cardCondition in array)
			{
				if (!((Object)(object)cardCondition == (Object)null) && !cardCondition.IsPlayerAllowedCard(player))
				{
					__result = false;
					break;
				}
			}
		}
	}
	[HarmonyPatch(typeof(ApplyCardStats), "ApplyStats")]
	internal class ApplyCardStatsPatch
	{
		public static void Postfix(ApplyCardStats __instance, Player ___playerToUpgrade)
		{
			CustomStatModifers[] components = ((Component)__instance).gameObject.GetComponents<CustomStatModifers>();
			for (int i = 0; i < components.Length; i++)
			{
				components[i].Apply(___playerToUpgrade);
			}
		}
	}
	[HarmonyPatch(typeof(Block))]
	internal class BlockPatch
	{
		[HarmonyPatch("blocked")]
		[HarmonyPrefix]
		public static void BlockedPrefix(Block __instance, GameObject projectile, Vector3 forward, Vector3 hitPos)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			ProjectileHit component = projectile.GetComponent<ProjectileHit>();
			HealthHandler val = (HealthHandler)ExtensionMethods.GetFieldValue((object)__instance, "health");
			float blockPircePercent = component.ownPlayer.data.GetAdditionalData().BlockPircePercent;
			if (blockPircePercent > 0f)
			{
				Vector2 val2 = Vector2.op_Implicit((component.bulletCanDealDeamage ? component.damage : 1f) * blockPircePercent * ((Vector3)(ref forward)).normalized);
				((Damagable)val).TakeDamage(val2, Vector2.op_Implicit(hitPos), component.projectileColor, component.ownWeapon, component.ownPlayer, true, true);
				Object.Destroy((Object)(object)projectile);
			}
		}
	}
	[HarmonyPatch(typeof(CardChoice))]
	internal class CardChoicePatch
	{
		[HarmonyPatch("IDoEndPick")]
		private static void Postfix(GameObject pickedCard, int pickId)
		{
			if (!((Object)(object)ExtensionMethods.GetPlayerWithID(PlayerManager.instance, pickId) == (Object)null))
			{
				PickCardTracker.instance.AddCardPickedInPickPhase(pickedCard.GetComponent<CardInfo>());
			}
		}
	}
	[HarmonyPatch(typeof(DamageOverTime))]
	internal class DamageOverTimePatch
	{
		[HarmonyPatch("TakeDamageOverTime")]
		[HarmonyPrefix]
		public static void TakeDamageOverTimePrefix(DamageOverTime __instance, Vector2 damage, Vector2 position, float time, float interval, Color color, SoundEvent soundDamageOverTime, GameObject damagingWeapon, Player damagingPlayer, bool lethal)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue();
			if (!HealthHandlerPatch.TakeDamageRunning)
			{
				DamageEventHandler.TriggerDamageEvent(DamageEventHandler.DamageEventType.OnTakeDamageOvertime, val.player, damagingPlayer, damage, lethal);
			}
		}
	}
	[HarmonyPatch(typeof(HealthHandler))]
	internal class HealthHandlerPatch
	{
		public static bool TakeDamageRunning;

		[HarmonyPatch("Revive")]
		[HarmonyPostfix]
		public static void RevivePrefix(HealthHandler __instance, CharacterData ___data)
		{
			ConstantDamageHandler.Instance.RemovePlayerFromAll(___data.player);
			((MonoBehaviour)DelayDamageHandler.Instance).StopAllCoroutines();
		}

		[HarmonyPatch("TakeDamage", new Type[]
		{
			typeof(Vector2),
			typeof(Vector2),
			typeof(Color),
			typeof(GameObject),
			typeof(Player),
			typeof(bool),
			typeof(bool)
		})]
		[HarmonyPrefix]
		public static void TakeDamagePrefix(HealthHandler __instance, Player damagingPlayer, Vector2 damage, bool lethal)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			TakeDamageRunning = true;
			CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue();
			DamageEventHandler.TriggerDamageEvent(DamageEventHandler.DamageEventType.OnTakeDamage, val.player, damagingPlayer, damage, lethal);
		}

		[HarmonyPatch("TakeDamage", new Type[]
		{
			typeof(Vector2),
			typeof(Vector2),
			typeof(Color),
			typeof(GameObject),
			typeof(Player),
			typeof(bool),
			typeof(bool)
		})]
		[HarmonyPostfix]
		public static void TakeDamagePostfix(HealthHandler __instance, Vector2 damage)
		{
			TakeDamageRunning = false;
		}

		[HarmonyPatch("DoDamage")]
		[HarmonyPrefix]
		public static void DoDamage(HealthHandler __instance, ref Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, bool lethal, bool ignoreBlock)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_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)
			CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue();
			val.GetAdditionalData();
			Vector2 damage2 = damage;
			DamageEventHandler.TriggerDamageEvent(DamageEventHandler.DamageEventType.OnDoDamage, val.player, damagingPlayer, damage2, lethal);
		}
	}
}
namespace AALUND13Cards.Core.MonoBehaviours
{
	public class DamageSpawnedAttack : SpawnedAttack
	{
		public Vector2 Damage;
	}
	public class DamageSpawnObjects : SpawnObjects, IOnDoDamageEvent, IOnTakeDamageEvent, IOnTakeDamageOvertimeEvent
	{
		public float DamageThreshold = 0.5f;

		public bool TriggerOnDamage;

		public bool TriggerOnTakeDamage = true;

		public bool TriggerOnOvertimeDamage = true;

		private Player player;

		public void Start()
		{
			player = ((Component)this).GetComponentInParent<Player>();
			DamageEventHandler.Instance.RegisterDamageEvent(this, player);
		}

		public void OnDestroy()
		{
			DamageEventHandler.Instance.UnregisterDamageEvent(this, player);
		}

		public void OnDamage(DamageInfo damage)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			if (TriggerOnDamage && ((Vector2)(ref damage.Damage)).magnitude >= DamageThreshold)
			{
				SpawnDamage(damage.Damage);
			}
		}

		public void OnTakeDamage(DamageInfo damage)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			if (TriggerOnTakeDamage && ((Vector2)(ref damage.Damage)).magnitude >= DamageThreshold)
			{
				SpawnDamage(damage.Damage);
			}
		}

		public void OnTakeDamageOvertime(DamageInfo damage)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			if (TriggerOnOvertimeDamage && ((Vector2)(ref damage.Damage)).magnitude >= DamageThreshold)
			{
				SpawnDamage(damage.Damage);
			}
		}

		public void SpawnDamage(Vector2 damage)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			GameObject[] objectToSpawn = base.objectToSpawn;
			for (int i = 0; i < objectToSpawn.Length; i++)
			{
				DamageSpawnedAttack component = objectToSpawn[i].GetComponent<DamageSpawnedAttack>();
				if ((Object)(object)component != (Object)null)
				{
					component.Damage = damage;
				}
			}
			((SpawnObjects)this).Spawn();
		}
	}
}
namespace AALUND13Cards.Core.MonoBehaviours.CardsEffects
{
	[RequireComponent(typeof(DamageSpawnedAttack), typeof(Explosion))]
	public class SetExplosionDamageOffTakennDamage : MonoBehaviour
	{
		public float ExplosionDamageMultiplier = 1f;

		private DamageSpawnedAttack damageSpawnedAttack;

		private Explosion explosion;

		private void Awake()
		{
			damageSpawnedAttack = ((Component)this).GetComponent<DamageSpawnedAttack>();
			explosion = ((Component)this).GetComponent<Explosion>();
		}

		private void Start()
		{
			explosion.damage = ((Vector2)(ref damageSpawnedAttack.Damage)).magnitude * ExplosionDamageMultiplier;
		}
	}
}
namespace AALUND13Cards.Core.Handlers
{
	internal class ConfigHandler
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__2_0;

			internal void <RegesterMenu>b__2_0()
			{
			}
		}

		public static ConfigEntry<bool> DetailsMode;

		public static ConfigEntry<bool> DebugMode;

		public static void RegesterMenu(ConfigFile config)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			object obj = <>c.<>9__2_0;
			if (obj == null)
			{
				UnityAction val = delegate
				{
				};
				<>c.<>9__2_0 = val;
				obj = (object)val;
			}
			Unbound.RegisterMenu("AALUND13 Cards Core", (UnityAction)obj, (Action<GameObject>)NewGui, (GameObject)null, false);
			DebugMode = config.Bind<bool>("AALUND13 Cards Core", "DebugMode", false, "Enabled or disabled Debug Mode");
		}

		public static void addBlank(GameObject menu)
		{
			TextMeshProUGUI val = default(TextMeshProUGUI);
			MenuHandler.CreateText(" ", menu, ref val, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
		}

		public static void NewGui(GameObject menu)
		{
			MenuHandler.CreateToggle(DebugMode.Value, "<#c41010> Debug Mode", menu, (UnityAction<bool>)DebugModeChanged, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			static void DebugModeChanged(bool val)
			{
				DebugMode.Value = val;
			}
		}
	}
	public struct ConstantDamageInfo
	{
		public Player DamagingPlayer;

		public Color Color;

		public float Damage;

		public ConstantDamageInfo(Player damagingPlayer, Color color, float damage)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			DamagingPlayer = damagingPlayer;
			Color = color;
			Damage = damage;
		}

		public ConstantDamageInfo AddDamage(float damage)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return new ConstantDamageInfo(DamagingPlayer, Color, Damage + damage);
		}
	}
	public class ConstantDamageHandler : MonoBehaviour
	{
		public Dictionary<Player, List<ConstantDamageInfo>> playerConstantDamages = new Dictionary<Player, List<ConstantDamageInfo>>();

		public Dictionary<Player, List<ConstantDamageInfo>> PlayerConstantPrecentageDamages = new Dictionary<Player, List<ConstantDamageInfo>>();

		public static ConstantDamageHandler Instance;

		public void AddConstantDamage(Player player, Player damagingPlayer, Color color, float damage)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			if (!playerConstantDamages.ContainsKey(player))
			{
				playerConstantDamages[player] = new List<ConstantDamageInfo>();
			}
			int num = playerConstantDamages[player].FindIndex((ConstantDamageInfo info) => info.Color == color);
			if (num != -1)
			{
				playerConstantDamages[player][num] = playerConstantDamages[player][num].AddDamage(damage);
			}
			else
			{
				playerConstantDamages[player].Add(new ConstantDamageInfo(damagingPlayer, color, damage));
			}
		}

		public void AddConstantPrecentageDamage(Player player, Player damagingPlayer, Color color, float precentage)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			if (!PlayerConstantPrecentageDamages.ContainsKey(player))
			{
				PlayerConstantPrecentageDamages[player] = new List<ConstantDamageInfo>();
			}
			int num = PlayerConstantPrecentageDamages[player].FindIndex((ConstantDamageInfo info) => info.Color == color);
			if (num != -1)
			{
				PlayerConstantPrecentageDamages[player][num] = PlayerConstantPrecentageDamages[player][num].AddDamage(precentage);
			}
			else
			{
				PlayerConstantPrecentageDamages[player].Add(new ConstantDamageInfo(damagingPlayer, color, precentage));
			}
		}

		internal void RemovePlayerFromAll(Player player)
		{
			if (playerConstantDamages.ContainsKey(player))
			{
				playerConstantDamages.Remove(player);
			}
			if (PlayerConstantPrecentageDamages.ContainsKey(player))
			{
				PlayerConstantPrecentageDamages.Remove(player);
			}
		}

		private void Start()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			else
			{
				Object.Destroy((Object)(object)this);
			}
			DeathHandler.OnPlayerDeath += (DeathHandlerDelegate)delegate(Player player, Dictionary<Player, DamageInfo> playerDamageInfo)
			{
				if (playerConstantDamages.ContainsKey(player))
				{
					playerConstantDamages.Remove(player);
				}
				if (PlayerConstantPrecentageDamages.ContainsKey(player))
				{
					PlayerConstantPrecentageDamages.Remove(player);
				}
			};
		}

		private void Update()
		{
			//IL_0061: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			foreach (KeyValuePair<Player, List<ConstantDamageInfo>> item in playerConstantDamages.ToList())
			{
				foreach (ConstantDamageInfo item2 in item.Value)
				{
					Player key = item.Key;
					float num = item2.Damage * Time.deltaTime;
					if (num > 0f)
					{
						key.data.healthHandler.DoDamage(Vector2.down * num, Vector2.zero, item2.Color, (GameObject)null, item2.DamagingPlayer, false, true, true);
					}
				}
			}
			foreach (KeyValuePair<Player, List<ConstantDamageInfo>> item3 in PlayerConstantPrecentageDamages.ToList())
			{
				foreach (ConstantDamageInfo item4 in item3.Value)
				{
					Player key2 = item3.Key;
					float num2 = item4.Damage * Time.deltaTime;
					if (num2 > 0f)
					{
						key2.data.healthHandler.DoDamage(Vector2.down * (key2.data.maxHealth * num2), Vector2.zero, item4.Color, (GameObject)null, item4.DamagingPlayer, false, true, true);
					}
				}
			}
		}
	}
	public struct DamageInfo
	{
		public Vector2 Damage;

		public bool IsLethal;

		public Player DamagingPlayer;

		public Player HurtPlayer;

		public DamageInfo(Vector2 damage, bool isLethal, Player damagingPlayer, Player hurtPlayer)
		{
			//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)
			Damage = damage;
			IsLethal = isLethal;
			DamagingPlayer = damagingPlayer;
			HurtPlayer = hurtPlayer;
		}
	}
	public interface IOnDoDamageEvent
	{
		void OnDamage(DamageInfo damage);
	}
	public interface IOnTakeDamageEvent
	{
		void OnTakeDamage(DamageInfo damage);
	}
	public interface IOnTakeDamageOvertimeEvent
	{
		void OnTakeDamageOvertime(DamageInfo damage);
	}
	public class DamageEventHandler : MonoBehaviour
	{
		public enum DamageEventType
		{
			OnDoDamage,
			OnTakeDamage,
			OnTakeDamageOvertime
		}

		internal Dictionary<Player, List<IOnDoDamageEvent>> OnDoDamageEvents = new Dictionary<Player, List<IOnDoDamageEvent>>();

		internal Dictionary<Player, List<IOnTakeDamageEvent>> OnTakeDamageEvents = new Dictionary<Player, List<IOnTakeDamageEvent>>();

		internal Dictionary<Player, List<IOnTakeDamageOvertimeEvent>> OnTakeDamageOvertimeEvents = new Dictionary<Player, List<IOnTakeDamageOvertimeEvent>>();

		internal Dictionary<Player, List<IOnDoDamageEvent>> OnDoDamageEventsOtherPlayer = new Dictionary<Player, List<IOnDoDamageEvent>>();

		internal Dictionary<Player, List<IOnTakeDamageEvent>> OnTakeDamageEventsOtherPlayer = new Dictionary<Player, List<IOnTakeDamageEvent>>();

		internal Dictionary<Player, List<IOnTakeDamageOvertimeEvent>> OnTakeDamageOvertimeEventsOtherPlayer = new Dictionary<Player, List<IOnTakeDamageOvertimeEvent>>();

		public static DamageEventHandler Instance;

		public void RegisterDamageEvent(object obj, Player player)
		{
			if (obj is IOnDoDamageEvent item)
			{
				if (!OnDoDamageEvents.ContainsKey(player))
				{
					OnDoDamageEvents[player] = new List<IOnDoDamageEvent>();
				}
				OnDoDamageEvents[player].Add(item);
			}
			if (obj is IOnTakeDamageEvent item2)
			{
				if (!OnTakeDamageEvents.ContainsKey(player))
				{
					OnTakeDamageEvents[player] = new List<IOnTakeDamageEvent>();
				}
				OnTakeDamageEvents[player].Add(item2);
			}
			if (obj is IOnTakeDamageOvertimeEvent item3)
			{
				if (!OnTakeDamageOvertimeEvents.ContainsKey(player))
				{
					OnTakeDamageOvertimeEvents[player] = new List<IOnTakeDamageOvertimeEvent>();
				}
				OnTakeDamageOvertimeEvents[player].Add(item3);
			}
		}

		public void RegisterDamageEventForOtherPlayers(object obj, Player player)
		{
			if (obj is IOnDoDamageEvent item)
			{
				if (!OnDoDamageEventsOtherPlayer.ContainsKey(player))
				{
					OnDoDamageEventsOtherPlayer[player] = new List<IOnDoDamageEvent>();
				}
				OnDoDamageEventsOtherPlayer[player].Add(item);
			}
			if (obj is IOnTakeDamageEvent item2)
			{
				if (!OnTakeDamageEventsOtherPlayer.ContainsKey(player))
				{
					OnTakeDamageEventsOtherPlayer[player] = new List<IOnTakeDamageEvent>();
				}
				OnTakeDamageEventsOtherPlayer[player].Add(item2);
			}
			if (obj is IOnTakeDamageOvertimeEvent item3)
			{
				if (!OnTakeDamageOvertimeEventsOtherPlayer.ContainsKey(player))
				{
					OnTakeDamageOvertimeEventsOtherPlayer[player] = new List<IOnTakeDamageOvertimeEvent>();
				}
				OnTakeDamageOvertimeEventsOtherPlayer[player].Add(item3);
			}
		}

		public void UnregisterDamageEvent(object obj, Player player)
		{
			if (obj is IOnDoDamageEvent item && OnDoDamageEvents.ContainsKey(player))
			{
				OnDoDamageEvents[player].Remove(item);
			}
			if (obj is IOnTakeDamageEvent item2 && OnTakeDamageEvents.ContainsKey(player))
			{
				OnTakeDamageEvents[player].Remove(item2);
			}
			if (obj is IOnTakeDamageOvertimeEvent item3 && OnTakeDamageOvertimeEvents.ContainsKey(player))
			{
				OnTakeDamageOvertimeEvents[player].Remove(item3);
			}
			if (obj is IOnDoDamageEvent item4 && OnDoDamageEventsOtherPlayer.ContainsKey(player))
			{
				OnDoDamageEventsOtherPlayer[player].Remove(item4);
			}
			if (obj is IOnTakeDamageEvent item5 && OnTakeDamageEventsOtherPlayer.ContainsKey(player))
			{
				OnTakeDamageEventsOtherPlayer[player].Remove(item5);
			}
			if (obj is IOnTakeDamageOvertimeEvent item6 && OnTakeDamageOvertimeEventsOtherPlayer.ContainsKey(player))
			{
				OnTakeDamageOvertimeEventsOtherPlayer[player].Remove(item6);
			}
		}

		internal static void TriggerDamageEvent(DamageEventType eventType, Player hurtPlayer, Player damagingPlayer, Vector2 damage, bool isLethal)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			DamageInfo damage2 = new DamageInfo(damage, isLethal, damagingPlayer, hurtPlayer);
			switch (eventType)
			{
			case DamageEventType.OnDoDamage:
				if (!Instance.OnDoDamageEvents.ContainsKey(hurtPlayer))
				{
					break;
				}
				foreach (IOnDoDamageEvent item in Instance.OnDoDamageEvents[hurtPlayer])
				{
					item.OnDamage(damage2);
				}
				break;
			case DamageEventType.OnTakeDamage:
				if (!Instance.OnTakeDamageEvents.ContainsKey(hurtPlayer))
				{
					break;
				}
				foreach (IOnTakeDamageEvent item2 in Instance.OnTakeDamageEvents[hurtPlayer])
				{
					item2.OnTakeDamage(damage2);
				}
				break;
			case DamageEventType.OnTakeDamageOvertime:
				if (!Instance.OnTakeDamageOvertimeEvents.ContainsKey(hurtPlayer))
				{
					break;
				}
				foreach (IOnTakeDamageOvertimeEvent item3 in Instance.OnTakeDamageOvertimeEvents[hurtPlayer])
				{
					item3.OnTakeDamageOvertime(damage2);
				}
				break;
			}
			foreach (KeyValuePair<Player, List<IOnDoDamageEvent>> item4 in Instance.OnDoDamageEventsOtherPlayer)
			{
				if (!((Object)(object)item4.Key != (Object)(object)hurtPlayer))
				{
					continue;
				}
				foreach (IOnDoDamageEvent item5 in item4.Value)
				{
					if (eventType == DamageEventType.OnDoDamage)
					{
						item5.OnDamage(damage2);
					}
				}
			}
			foreach (KeyValuePair<Player, List<IOnTakeDamageEvent>> item6 in Instance.OnTakeDamageEventsOtherPlayer)
			{
				if (!((Object)(object)item6.Key != (Object)(object)hurtPlayer))
				{
					continue;
				}
				foreach (IOnTakeDamageEvent item7 in item6.Value)
				{
					if (eventType == DamageEventType.OnTakeDamage)
					{
						item7.OnTakeDamage(damage2);
					}
				}
			}
			foreach (KeyValuePair<Player, List<IOnTakeDamageOvertimeEvent>> item8 in Instance.OnTakeDamageOvertimeEventsOtherPlayer)
			{
				if (!((Object)(object)item8.Key != (Object)(object)hurtPlayer))
				{
					continue;
				}
				foreach (IOnTakeDamageOvertimeEvent item9 in item8.Value)
				{
					if (eventType == DamageEventType.OnTakeDamageOvertime)
					{
						item9.OnTakeDamageOvertime(damage2);
					}
				}
			}
		}

		private void Awake()
		{
			if ((Object)(object)Instance != (Object)null)
			{
				Object.Destroy((Object)(object)this);
			}
			else
			{
				Instance = this;
			}
		}
	}
	public struct DelayDamageInfo
	{
		public Vector2 Damage;

		public Vector2 Position;

		public Color BlinkColor;

		public GameObject DamagingWeapon;

		public Player DamagingPlayer;

		public bool HealthRemoval;

		public bool Lethal;

		public bool IngnoreBlock;

		public DelayDamageInfo(Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon = null, Player damagingPlayer = null, bool healthRemoval = false, bool lethal = true, bool ignoreBlock = false)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Damage = damage;
			Position = position;
			BlinkColor = blinkColor;
			DamagingWeapon = damagingWeapon;
			DamagingPlayer = damagingPlayer;
			HealthRemoval = healthRemoval;
			Lethal = lethal;
			IngnoreBlock = ignoreBlock;
		}
	}
	public class DelayDamageHandler : MonoBehaviour
	{
		public Player player;

		public static DelayDamageHandler Instance { get; private set; }

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

		public void DelayDamage(DelayDamageInfo delayDamageInfo, float delay, Action beforeDamageCall = null, Action afterDamageCall = null)
		{
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)this, delay, (Action)delegate
			{
				//IL_002c: 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_0042: Unknown result type (might be due to invalid IL or missing references)
				beforeDamageCall?.Invoke();
				player.data.healthHandler.DoDamage(delayDamageInfo.Damage, delayDamageInfo.Position, delayDamageInfo.BlinkColor, delayDamageInfo.DamagingWeapon, delayDamageInfo.DamagingPlayer, delayDamageInfo.HealthRemoval, delayDamageInfo.Lethal, delayDamageInfo.IngnoreBlock);
				afterDamageCall?.Invoke();
			});
		}
	}
}
namespace AALUND13Cards.Core.Extensions
{
	public class AALUND13CardCharacterDataAdditionalData
	{
		public float BlockPircePercent;

		public CustomStatsRegistry CustomStatsRegistry = new CustomStatsRegistry();

		public void Reset()
		{
			BlockPircePercent = 0f;
			CustomStatsRegistry.ResetAll();
		}
	}
	public static class CharacterDataExtensions
	{
		public static readonly ConditionalWeakTable<CharacterData, AALUND13CardCharacterDataAdditionalData> data = new ConditionalWeakTable<CharacterData, AALUND13CardCharacterDataAdditionalData>();

		public static AALUND13CardCharacterDataAdditionalData GetAdditionalData(this CharacterData characterData)
		{
			return data.GetOrCreateValue(characterData);
		}

		public static CustomStatsRegistry GetCustomStatsRegistry(this CharacterData characterData)
		{
			return data.GetOrCreateValue(characterData).CustomStatsRegistry;
		}

		public static void AddData(this CharacterData characterData, AALUND13CardCharacterDataAdditionalData value)
		{
			try
			{
				data.Add(characterData, value);
			}
			catch (Exception)
			{
			}
		}
	}
	public static class PlayerExtensions
	{
		public static float GetDPS(this Player player)
		{
			float num = player.data.weaponHandler.gun.damage * player.data.weaponHandler.gun.bulletDamageMultiplier * player.data.weaponHandler.gun.projectiles[0].objectToSpawn.GetComponent<ProjectileHit>().damage * player.data.weaponHandler.gun.chargeDamageMultiplier;
			GunAmmo componentInChildren = ((Component)player.data.weaponHandler.gun).GetComponentInChildren<GunAmmo>();
			int maxAmmo = componentInChildren.maxAmmo;
			int num2 = (int)((float)player.data.weaponHandler.gun.numberOfProjectiles + player.data.weaponHandler.gun.chargeNumberOfProjectilesTo);
			int num3 = Mathf.Max(player.data.weaponHandler.gun.bursts, 1);
			float timeBetweenBullets = player.data.weaponHandler.gun.timeBetweenBullets;
			float num4 = (float)ExtensionMethods.InvokeMethod((object)componentInChildren, "ReloadTime", Array.Empty<object>());
			float num5 = Mathf.Max(player.data.weaponHandler.gun.attackSpeed, 0.01f);
			int num6 = num3 * num2;
			int num7 = Mathf.Max(maxAmmo / num6, 1);
			float num8 = (float)(num3 - 1) * timeBetweenBullets;
			float num9 = (num5 + num8) * (float)(num7 - 1) + Mathf.Max(num4, num5 + num8);
			float num10 = 1f / num9;
			return num * (float)num7 * (float)num6 * num10 / 1.33333f;
		}

		public static float GetSPS(this Player player)
		{
			GunAmmo componentInChildren = ((Component)player.data.weaponHandler.gun).GetComponentInChildren<GunAmmo>();
			int maxAmmo = componentInChildren.maxAmmo;
			int num = (int)((float)player.data.weaponHandler.gun.numberOfProjectiles + player.data.weaponHandler.gun.chargeNumberOfProjectilesTo);
			int num2 = Mathf.Max(player.data.weaponHandler.gun.bursts, 1);
			float timeBetweenBullets = player.data.weaponHandler.gun.timeBetweenBullets;
			float num3 = (float)ExtensionMethods.InvokeMethod((object)componentInChildren, "ReloadTime", Array.Empty<object>());
			float num4 = Mathf.Max(player.data.weaponHandler.gun.attackSpeed, 0.01f);
			int num5 = num2 * num;
			int num6 = Mathf.Max(maxAmmo / num5, 1);
			float num7 = (float)(num2 - 1) * timeBetweenBullets;
			float num8 = (num4 + num7) * (float)(num6 - 1) + Mathf.Max(num3, num4 + num7);
			return (float)(num6 * num) / num8;
		}
	}
}
namespace AALUND13Cards.Core.Cards
{
	public enum CardListingCategory
	{
		Standard,
		ExtraCards,
		Curses,
		Armor,
		ClassesSoulstreak,
		ClassesReaper,
		ClassesExoArmor
	}
	public class AACustomCard : CustomUnityCard, IToggleCardCategory
	{
		public string RequireMod = "";

		public bool IsCursed;

		public CardListingCategory Category;

		public override void OnRegister(CardInfo cardInfo)
		{
			if (IsCursed)
			{
				CurseManager.instance.RegisterCurse(cardInfo);
				List<CardCategory> list = new List<CardCategory>(cardInfo.categories) { CustomCardCategories.instance.CardCategory("Curse") };
				cardInfo.categories = list.ToArray();
			}
		}

		public override void OnReassignCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			CustomStatModifers[] components = ((Component)this).GetComponents<CustomStatModifers>();
			for (int i = 0; i < components.Length; i++)
			{
				components[i].OnReassign(player);
			}
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			OnAddedEffect[] components = ((Component)this).GetComponents<OnAddedEffect>();
			for (int i = 0; i < components.Length; i++)
			{
				components[i].OnAdded(player, gun, gunAmmo, data, health, gravity, block, characterStats);
			}
		}

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

		public ToggleCardCategoryInfo GetCardCategoryInfo()
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			return new ToggleCardCategoryInfo(Category switch
			{
				CardListingCategory.ExtraCards => "Extra Cards", 
				CardListingCategory.Armor => "Armors", 
				CardListingCategory.Curses => "Curses", 
				CardListingCategory.ClassesReaper => "Classes/Reaper", 
				CardListingCategory.ClassesSoulstreak => "Classes/Soulstreak", 
				CardListingCategory.ClassesExoArmor => "Classes/Exo Armor", 
				_ => "Standard", 
			}, (int?)null);
		}
	}
	public class CardResgester : MonoBehaviour
	{
		public static List<CardInfo> AllModCards = new List<CardInfo>();

		public List<GameObject> Cards;

		private Dictionary<string, CardInfo> ModCards = new Dictionary<string, CardInfo>();

		private void SetupCard(CustomCard customCard)
		{
			if (!((Object)(object)customCard == (Object)null))
			{
				customCard.cardInfo = ((Component)customCard).GetComponent<CardInfo>();
				customCard.gun = ((Component)customCard).GetComponent<Gun>();
				customCard.cardStats = ((Component)customCard).GetComponent<ApplyCardStats>();
				customCard.statModifiers = ((Component)customCard).GetComponent<CharacterStatModifiers>();
				customCard.block = ExtensionMethods.GetOrAddComponent<Block>(((Component)customCard).gameObject, false);
				customCard.SetupCard(customCard.cardInfo, customCard.gun, customCard.cardStats, customCard.statModifiers, customCard.block);
			}
		}

		public void RegisterCards()
		{
			foreach (GameObject card in Cards)
			{
				CardInfo component = card.GetComponent<CardInfo>();
				AACustomCard customCard = card.GetComponent<AACustomCard>();
				if ((Object)(object)component == (Object)null)
				{
					Debug.LogError((object)("[AALUND13 Cards Core][Card] " + ((Object)card).name + " does not have a 'CardInfo' component"));
					continue;
				}
				if ((Object)(object)customCard == (Object)null)
				{
					Debug.LogError((object)("[AALUND13 Cards Core][Card] " + component.cardName + " does not have a 'AACustomCard' component"));
					continue;
				}
				if (!Utility.IsNullOrWhiteSpace(customCard.RequireMod) && !AAC_Core.Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == customCard.RequireMod))
				{
					Debug.LogWarning((object)("[AALUND13 Cards Core][Card] " + component.cardName + " does not have the require mod of '" + customCard.RequireMod + "'"));
					continue;
				}
				try
				{
					SetupCard((CustomCard)(object)customCard);
				}
				catch (Exception arg)
				{
					Debug.LogError((object)string.Format("[{0}][Card] {1} failed to setup the card: {2}", "AALUND13 Cards Core", component.cardName, arg));
					continue;
				}
				((CustomCard)customCard).RegisterUnityCard((Action<CardInfo>)delegate(CardInfo registerCardInfo)
				{
					try
					{
						((CustomUnityCard)customCard).Register(registerCardInfo);
					}
					catch (Exception arg2)
					{
						Debug.LogError((object)string.Format("[{0}][Card] {1} failed to execute the 'Register' method: {2}", "AALUND13 Cards Core", registerCardInfo.cardName, arg2));
					}
				});
				Debug.Log((object)("[AALUND13 Cards Core][Card] Registered Card: " + component.cardName));
				ModCards.Add(component.cardName, component);
				AllModCards.Add(component);
			}
		}
	}
	public abstract class CustomStatModifers : MonoBehaviour
	{
		public abstract void Apply(Player player);

		public virtual void OnReassign(Player player)
		{
		}
	}
}
namespace AALUND13Cards.Core.Cards.StatModifers
{
	public class AAStatModifers : CustomStatModifers
	{
		[Header("Blocks Stats")]
		public float BlockPircePercent;

		public override void Apply(Player player)
		{
			AALUND13CardCharacterDataAdditionalData additionalData = player.data.GetAdditionalData();
			additionalData.BlockPircePercent = Mathf.Clamp(additionalData.BlockPircePercent + BlockPircePercent, 0f, 1f);
		}
	}
}
namespace AALUND13Cards.Core.Cards.Effects
{
	public abstract class OnAddedEffect : MonoBehaviour
	{
		public abstract void OnAdded(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats);
	}
}
namespace AALUND13Cards.Core.Cards.Conditions
{
	public abstract class CardCondition : MonoBehaviour
	{
		public CardInfo CardInfo => ((Component)this).GetComponent<CardInfo>();

		public abstract bool IsPlayerAllowedCard(Player player);
	}
	public class CardLimitCondition : CardCondition
	{
		public int AllowedAmount = 1;

		public override bool IsPlayerAllowedCard(Player player)
		{
			if (PlayerManager.instance.players.SelectMany((Player p) => p.data.currentCards).ToArray().Count((CardInfo c) => (Object)(object)c == (Object)(object)base.CardInfo) >= AllowedAmount)
			{
				return false;
			}
			return true;
		}
	}
	internal class MinEnemyPlayersCondition : CardCondition
	{
		public int MinEnemyPlayers = 2;

		public override bool IsPlayerAllowedCard(Player player)
		{
			return PlayerStatus.GetEnemyPlayers(player).Count >= MinEnemyPlayers;
		}
	}
	public class MinPlayersCondition : CardCondition
	{
		public int MinPlayers = 3;

		public override bool IsPlayerAllowedCard(Player player)
		{
			return PlayerManager.instance.players.Count >= MinPlayers;
		}
	}
	public class PickPhaseLimitCondition : CardCondition
	{
		public int AllowedPickCount = 1;

		public override bool IsPlayerAllowedCard(Player player)
		{
			if (PickCardTracker.instance.CardPickedInPickPhase.Count((CardInfo c) => (Object)(object)c == (Object)(object)base.CardInfo) >= AllowedPickCount)
			{
				return false;
			}
			return true;
		}
	}
	public class PlayerHaveRegenCondition : CardCondition
	{
		public float MinRegen;

		public override bool IsPlayerAllowedCard(Player player)
		{
			return player.data.healthHandler.regeneration >= MinRegen;
		}
	}
}

plugins/AALUND13_Classes_Cards.dll

Decompiled 3 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AALUND13Cards.Armors.Utils;
using AALUND13Cards.Classes;
using AALUND13Cards.Classes.Armors;
using AALUND13Cards.Classes.Cards;
using AALUND13Cards.Classes.MonoBehaviours.CardsEffects.Soulstreak;
using AALUND13Cards.Classes.MonoBehaviours.CardsEffects.Soulstreak.Abilities;
using AALUND13Cards.Classes.Utils;
using AALUND13Cards.Core;
using AALUND13Cards.Core.Cards;
using AALUND13Cards.Core.Cards.Conditions;
using AALUND13Cards.Core.Extensions;
using AALUND13Cards.Core.Handlers;
using AALUND13Cards.Core.MonoBehaviours;
using AALUND13Cards.Core.Utils;
using BepInEx;
using HarmonyLib;
using JARL.Armor;
using JARL.Armor.Bases;
using JARL.Utils;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.GameModes;
using ModdingUtils.MonoBehaviours;
using ModsPlus;
using Photon.Pun;
using Sonigon;
using SoundImplementation;
using TMPro;
using TabInfo.Utils;
using UnboundLib;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[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]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AALUND13Cards.Core.Patches
{
	[HarmonyPatch(typeof(Gun))]
	public class GunPatch
	{
		[CompilerGenerated]
		private sealed class <Transpiler>d__2 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private CodeInstruction <>2__current;

			private int <>l__initialThreadId;

			private IEnumerable<CodeInstruction> instructions;

			public IEnumerable<CodeInstruction> <>3__instructions;

			private IEnumerator<CodeInstruction> <>7__wrap1;

			private CodeInstruction <code>5__3;

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

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

			[DebuggerHidden]
			public <Transpiler>d__2(int <>1__state)
			{
				this.<>1__state = <>1__state;
				<>l__initialThreadId = Environment.CurrentManagedThreadId;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if (num == -3 || (uint)(num - 1) <= 2u)
				{
					try
					{
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<>7__wrap1 = null;
				<code>5__3 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Expected O, but got Unknown
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				//IL_0082: Expected O, but got Unknown
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<>7__wrap1 = instructions.GetEnumerator();
						<>1__state = -3;
						goto IL_00f7;
					case 1:
						<>1__state = -3;
						<>2__current = new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(GunPatch), "InjectUseCharge", (Type[])null, (Type[])null));
						<>1__state = 2;
						return true;
					case 2:
						<>1__state = -3;
						goto IL_00d1;
					case 3:
						{
							<>1__state = -3;
							<code>5__3 = null;
							goto IL_00f7;
						}
						IL_00f7:
						if (<>7__wrap1.MoveNext())
						{
							<code>5__3 = <>7__wrap1.Current;
							if (<code>5__3.opcode == OpCodes.Ret)
							{
								<>2__current = new CodeInstruction(OpCodes.Ldarg_0, (object)null);
								<>1__state = 1;
								return true;
							}
							goto IL_00d1;
						}
						<>m__Finally1();
						<>7__wrap1 = null;
						return false;
						IL_00d1:
						<>2__current = <code>5__3;
						<>1__state = 3;
						return true;
					}
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

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

			private void <>m__Finally1()
			{
				<>1__state = -1;
				if (<>7__wrap1 != null)
				{
					<>7__wrap1.Dispose();
				}
			}

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

			[DebuggerHidden]
			IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
			{
				<Transpiler>d__2 <Transpiler>d__;
				if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
				{
					<>1__state = 0;
					<Transpiler>d__ = this;
				}
				else
				{
					<Transpiler>d__ = new <Transpiler>d__2(0);
				}
				<Transpiler>d__.instructions = <>3__instructions;
				return <Transpiler>d__;
			}

			[DebuggerHidden]
			IEnumerator IEnumerable.GetEnumerator()
			{
				return ((IEnumerable<CodeInstruction>)this).GetEnumerator();
			}
		}

		[HarmonyPatch("ApplyProjectileStats")]
		public static void Prefix(Gun __instance, GameObject obj)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//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)
			RailgunStats orCreate = CharacterDataExtensions.GetCustomStatsRegistry(__instance.player.data).GetOrCreate<RailgunStats>();
			if (orCreate.IsEnabled)
			{
				ProjectileHit component = obj.GetComponent<ProjectileHit>();
				MoveTransform component2 = obj.GetComponent<MoveTransform>();
				RailgunStats.RailgunChargeStats chargeStats = orCreate.GetChargeStats(orCreate.CurrentCharge);
				component2.localForce *= chargeStats.ChargeBulletSpeedMultiplier;
				component.damage *= chargeStats.ChargeDamageMultiplier;
			}
		}

		[HarmonyPatch("ApplyProjectileStats")]
		public static void Postfix(Gun __instance, GameObject obj)
		{
			ProjectileHit component = obj.GetComponent<ProjectileHit>();
			component.percentageDamage += MathUtils.GetEffectivePercentCap(PlayerExtensions.GetSPS(__instance.player), CharacterDataExtensions.GetCustomStatsRegistry(__instance.player.data).GetOrCreate<ReaperStats>().ScalingPercentageDamage, CharacterDataExtensions.GetCustomStatsRegistry(__instance.player.data).GetOrCreate<ReaperStats>().ScalingPercentageDamageCap);
			component.percentageDamage += MathUtils.GetEffectivePercent(PlayerExtensions.GetSPS(__instance.player), CharacterDataExtensions.GetCustomStatsRegistry(__instance.player.data).GetOrCreate<ReaperStats>().ScalingPercentageDamageUnCap);
		}

		[IteratorStateMachine(typeof(<Transpiler>d__2))]
		[HarmonyPatch("DoAttack")]
		public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Transpiler>d__2(-2)
			{
				<>3__instructions = instructions
			};
		}

		public static void InjectUseCharge(Gun gun)
		{
			RailgunStats orCreate = CharacterDataExtensions.GetCustomStatsRegistry(gun.player.data).GetOrCreate<RailgunStats>();
			if (orCreate.IsEnabled && orCreate.CurrentCharge > 0f)
			{
				orCreate.UseCharge(orCreate);
			}
		}
	}
}
namespace AALUND13Cards.Core.MonoBehaviours.CardsEffects
{
	public class RailgunMono : MonoBehaviour
	{
		[HideInInspector]
		public RailgunStats RailgunStats;

		private CustomHealthBar RailgunChargeBar;

		private Player player;

		private void Start()
		{
			player = ((Component)this).GetComponentInParent<Player>();
			RailgunStats = CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<RailgunStats>();
			RailgunStats.IsEnabled = true;
			RailgunChargeBar = CreateChargeBar();
			HealthHandler healthHandler = player.data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive));
		}

		public void OnDestroy()
		{
			Object.Destroy((Object)(object)((Component)RailgunChargeBar).gameObject);
			RailgunStats.IsEnabled = false;
			HealthHandler healthHandler = player.data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive));
		}

		public void Update()
		{
			if (RailgunStats.IsEnabled)
			{
				RailgunStats.CurrentCharge = Mathf.Min(RailgunStats.CurrentCharge + RailgunStats.ChargeRate * TimeHandler.deltaTime, RailgunStats.MaximumCharge);
			}
			RailgunChargeBar.SetValues(RailgunStats.CurrentCharge, RailgunStats.MaximumCharge);
		}

		public void OnRevive()
		{
			RailgunStats.CurrentCharge = RailgunStats.MaximumCharge;
		}

		private CustomHealthBar CreateChargeBar()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Railgun Charge Bar");
			CustomHealthBar obj = val.AddComponent<CustomHealthBar>();
			obj.SetColor(Color.cyan * 0.8f);
			ExtensionMethods.AddStatusIndicator(player, val, 0f, true);
			Object.Destroy((Object)(object)((Component)val.transform.Find("Healthbar(Clone)/Canvas/Image/White")).gameObject);
			return obj;
		}
	}
	public class RailgunOvercharge : MonoBehaviour
	{
		[SerializeField]
		private SoundEvent soundEmpowerSpawn;

		private CharacterData data;

		private ParticleSystem[] parts;

		private Transform particleTransform;

		private RailgunMono railgun;

		private bool isOn;

		private void Start()
		{
			parts = ((Component)this).GetComponentsInChildren<ParticleSystem>();
			particleTransform = ((Component)this).transform.GetChild(0);
			railgun = ((Component)((Component)this).transform.parent).GetComponentInChildren<RailgunMono>();
			data = ((Component)this).GetComponentInParent<CharacterData>();
			Block block = data.block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(Block));
			HealthHandler healthHandler = data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(ResetOvercharge));
			soundEmpowerSpawn.variables.audioMixerGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
		}

		private void OnDestroy()
		{
			Block block = data.block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(Block));
			HealthHandler healthHandler = data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(ResetOvercharge));
			railgun.RailgunStats.AllowOvercharge = false;
		}

		public void Block(BlockTriggerType trigger)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Invalid comparison between Unknown and I4
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Invalid comparison between Unknown and I4
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Invalid comparison between Unknown and I4
			if ((int)trigger != 3 && (int)trigger != 4 && (int)trigger != 2)
			{
				railgun.RailgunStats.AllowOvercharge = true;
			}
		}

		private void ResetOvercharge()
		{
			railgun.RailgunStats.AllowOvercharge = false;
		}

		private void Update()
		{
			//IL_0047: 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)
			ParticleSystem[] array = parts;
			foreach (ParticleSystem val in array)
			{
				if (railgun.RailgunStats.AllowOvercharge)
				{
					((Component)particleTransform).transform.position = ((Component)data.weaponHandler.gun).transform.position;
					((Component)particleTransform).transform.rotation = ((Component)data.weaponHandler.gun).transform.rotation;
					if (!isOn)
					{
						SoundManager.Instance.PlayAtPosition(soundEmpowerSpawn, SoundManager.Instance.GetTransform(), ((Component)this).transform);
						val.Play();
						isOn = true;
					}
				}
				else if (!railgun.RailgunStats.AllowOvercharge && isOn)
				{
					val.Stop();
					isOn = false;
				}
			}
		}
	}
}
namespace AALUND13Cards.Classes
{
	public class ArmorInterface
	{
		public static void RegisterArmors()
		{
			ArmorFramework.RegisterArmorType<SoulArmor>();
			ArmorTypeGetterUtils.RegiterArmorType<ExoArmor>("Exo-Armor");
		}
	}
}
namespace AALUND13Cards.Classes.Utils
{
	public static class MathUtils
	{
		public const float PERCENT_CAP = 0.8f;

		public static float GetEffectivePercentCap(float sps, float basePercent, float percentCap = 0.8f)
		{
			float num = Mathf.Max(0.0001f, sps);
			float num2 = Mathf.Min(percentCap, 0.8f);
			return Mathf.Min(Mathf.Min(basePercent, num2) * (1f / Mathf.Sqrt(num)), num2);
		}

		public static float GetEffectivePercent(float sps, float basePercent)
		{
			float num = Mathf.Max(0.0001f, sps);
			return basePercent * (1f / Mathf.Sqrt(num));
		}
	}
}
namespace AALUND13Cards.Classes.Patches
{
	[HarmonyPatch(typeof(ProjectileHit), "Hit")]
	internal class ProjectileHitPatch
	{
		private static bool Prefix(ProjectileHit __instance, HitInfo hit, bool forceCall)
		{
			//IL_008f: 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_009e: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			HealthHandler val = null;
			if (Object.op_Implicit((Object)(object)hit.transform))
			{
				val = ((Component)hit.transform).GetComponent<HealthHandler>();
			}
			if (Object.op_Implicit((Object)(object)val))
			{
				Player component = ((Component)val).GetComponent<Player>();
				ExoArmor exoArmor = (ExoArmor)(object)ArmorFramework.ArmorHandlers[component].GetArmorByType<ExoArmor>();
				if ((Object)(object)component != (Object)null && ((ArmorBase)exoArmor).IsActive && exoArmor.Reflect(GetBulletDamage(((Component)__instance).GetComponent<ProjectileHit>(), component)))
				{
					((Component)__instance).GetComponent<ProjectileHit>().RemoveOwnPlayerFromPlayersHit();
					((Component)__instance).GetComponent<ProjectileHit>().AddPlayerToHeld(val);
					MoveTransform component2 = ((Component)__instance).GetComponent<MoveTransform>();
					component2.velocity *= -1f;
					Transform transform = ((Component)__instance).transform;
					transform.position += ((Component)__instance).GetComponent<MoveTransform>().velocity * TimeHandler.deltaTime;
					((Component)__instance).GetComponent<RayCastTrail>().WasBlocked();
					if (__instance.destroyOnBlock)
					{
						ExtensionMethods.InvokeMethod((object)__instance, "DestroyMe", Array.Empty<object>());
					}
					__instance.sinceReflect = 0f;
					return false;
				}
			}
			return true;
		}

		private static float GetBulletDamage(ProjectileHit projectileHit, Player targetPlayer)
		{
			float damage = projectileHit.damage;
			float percentageDamage = projectileHit.percentageDamage;
			return damage + targetPlayer.data.maxHealth * percentageDamage;
		}
	}
}
namespace AALUND13Cards.Classes.MonoBehaviours.ProjectilesEffects
{
	public class RayHitWithering : RayHitEffect
	{
		public float PercentageDamagePerSecond = 0.005f;

		public override HasToReturn DoHitEffect(HitInfo hit)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)hit.transform))
			{
				CharacterData component = ((Component)hit.transform).GetComponent<CharacterData>();
				if (!((Object)(object)component == (Object)null) && !component.dead)
				{
					float effectivePercentCap = MathUtils.GetEffectivePercentCap(PlayerExtensions.GetSPS(((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer), PercentageDamagePerSecond);
					ConstantDamageHandler.Instance.AddConstantPrecentageDamage(component.player, ((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer, Color.black, effectivePercentCap);
					return (HasToReturn)1;
				}
				return (HasToReturn)1;
			}
			return (HasToReturn)1;
		}
	}
	public class SetProjectileDamage : MonoBehaviour
	{
		public float damage;

		private void Start()
		{
			((Component)this).GetComponentInParent<ProjectileHit>().damage = damage;
		}
	}
}
namespace AALUND13Cards.Classes.MonoBehaviours.CardsEffects.Soulstreak
{
	public class SoulstreakDrain : MonoBehaviour
	{
		[Header("Sounds")]
		public SoundEvent SoundDamage;

		private SoulStreakStats soulstreakStats;

		private PlayerInRangeTrigger playerInRangeTrigger;

		private Player player;

		public void Start()
		{
			player = ((Component)this).GetComponentInParent<Player>();
			soulstreakStats = CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<SoulStreakStats>();
			SoundDamage.variables.audioMixerGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
			playerInRangeTrigger = ((Component)this).GetComponent<PlayerInRangeTrigger>();
		}

		public void TriggerDamage()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			if (soulstreakStats != null)
			{
				Player closestEnemy = GetClosestEnemy();
				if (!((Object)(object)closestEnemy == (Object)null))
				{
					float dPS = PlayerExtensions.GetDPS(player);
					float num = dPS * soulstreakStats.SoulDrainDPSFactor * playerInRangeTrigger.cooldown;
					float num2 = Mathf.Min(num, closestEnemy.data.health);
					float num3 = Mathf.Max(0f, num2 * soulstreakStats.SoulDrainLifestealMultiply);
					((Damagable)closestEnemy.data.healthHandler).TakeDamage(num * Vector2.up, Vector2.op_Implicit(((Component)this).transform.position), (GameObject)null, player, true, true);
					player.data.healthHandler.Heal(num3);
					SoundManager.Instance.Play(SoundDamage, ((Component)closestEnemy).transform);
					LoggerUtils.LogInfo($"DPS: {dPS}, Damage: {num}, Lifesteal: {num3}");
				}
			}
		}

		private Player GetClosestEnemy()
		{
			//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_0058: 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)
			Player result = null;
			float num = float.MaxValue;
			foreach (Player player in PlayerManager.instance.players)
			{
				if ((Object)(object)player != (Object)(object)this.player && player.data.isPlaying)
				{
					float num2 = Vector2.Distance(Vector2.op_Implicit(((Component)this.player).transform.position), Vector2.op_Implicit(((Component)player).transform.position));
					if (num2 < num)
					{
						num = num2;
						result = player;
					}
				}
			}
			return result;
		}
	}
	public class SoulstreakEffect : ReversibleEffect, IPickStartHookHandler, IGameStartHookHandler
	{
		public override void OnStart()
		{
			InterfaceGameModeHooksManager.instance.RegisterHooks((object)this);
			((ReversibleEffect)this).SetLivesToEffect(int.MaxValue);
			base.applyImmediately = false;
			ApplyStats();
		}

		public void ApplyStats()
		{
			SoulStreakStats orCreate = CharacterDataExtensions.GetCustomStatsRegistry(base.data).GetOrCreate<SoulStreakStats>();
			uint souls = orCreate.Souls;
			((ReversibleEffect)this).ClearModifiers(true);
			base.characterDataModifier.maxHealth_mult = 1f + (orCreate.MaxHealth - 1f) * (float)souls;
			base.characterStatModifiersModifier.sizeMultiplier_mult = 1f + (orCreate.PlayerSize - 1f) * (float)souls;
			base.characterStatModifiersModifier.movementSpeed_mult = 1f + (orCreate.MovementSpeed - 1f) * (float)souls;
			base.gunStatModifier.attackSpeed_mult = 1f + (orCreate.AttackSpeed - 1f) * (float)souls;
			base.gunStatModifier.damage_mult = 1f + (orCreate.Damage - 1f) * (float)souls;
			base.gunStatModifier.projectileSpeed_mult = 1f + (orCreate.BulletSpeed - 1f) * (float)souls;
			((ReversibleEffect)this).ApplyModifiers();
		}

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

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

		public override void OnOnDestroy()
		{
			InterfaceGameModeHooksManager.instance.RemoveHooks((object)this);
		}
	}
	public class SoulstreakMono : MonoBehaviour, IBattleStartHookHandler
	{
		public GameObject SoulsCounter;

		public GameObject SoulsCounterGUI;

		public SoulStreakStats SoulstreakStats;

		private CharacterData data;

		public CharacterData Data => data;

		private string SoulsString => string.Format("{0}: {1}", (SoulstreakStats.Souls > 1) ? "Souls" : "Soul", SoulstreakStats.Souls);

		public void BlockAbility()
		{
			foreach (ISoulstreakAbility ability in SoulstreakStats.Abilities)
			{
				ability.OnBlock(this);
			}
		}

		public void ResetSouls()
		{
			if (GameManager.instance.battleOngoing)
			{
				LoggerUtils.LogInfo($"Resetting kill streak of player with ID {data.player.playerID}");
				if ((Object)(object)((Component)data).gameObject.GetComponent<SoulstreakEffect>() != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)data).gameObject.GetComponent<SoulstreakEffect>());
				}
				SoulstreakStats.Souls = 0u;
				if (data.view.IsMine)
				{
					((TMP_Text)SoulsCounterGUI.GetComponentInChildren<TextMeshProUGUI>()).text = SoulsString;
				}
			}
		}

		public void AddSouls(uint kills = 1u)
		{
			if (GameManager.instance.battleOngoing)
			{
				LoggerUtils.LogInfo($"Adding {kills} kills for player with ID {data.player.playerID}");
				SoulstreakStats.Souls += kills;
				ExtensionMethods.GetOrAddComponent<SoulstreakEffect>(((Component)data).gameObject, false).ApplyStats();
			}
		}

		public void OnBattleStart()
		{
			ExtensionMethods.GetOrAddComponent<SoulstreakEffect>(((Component)data).gameObject, false).ApplyStats();
		}

		private void OnRevive()
		{
			foreach (ISoulstreakAbility ability in SoulstreakStats.Abilities)
			{
				ability.OnReset(this);
			}
		}

		private void Start()
		{
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			data = ((Component)this).GetComponentInParent<Player>().data;
			SoulstreakStats = CharacterDataExtensions.GetAdditionalData(data).CustomStatsRegistry.GetOrCreate<SoulStreakStats>();
			SoulsCounter = Object.Instantiate<GameObject>(SoulsCounter);
			if (data.view.IsMine && !((Behaviour)((Component)data).GetComponent<PlayerAPI>()).enabled)
			{
				SoulsCounterGUI = Object.Instantiate<GameObject>(SoulsCounterGUI);
				SoulsCounterGUI.transform.SetParent(((Component)data).transform.parent);
			}
			data.SetWobbleObjectChild(SoulsCounter.transform);
			SoulsCounter.transform.localPosition = Vector2.op_Implicit(new Vector2(0f, 0.3f));
			InterfaceGameModeHooksManager.instance.RegisterHooks((object)this);
			HealthHandler healthHandler = data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive));
		}

		private void OnDestroy()
		{
			if (data.view.IsMine && !((Behaviour)((Component)data).GetComponent<PlayerAPI>()).enabled)
			{
				Object.Destroy((Object)(object)SoulsCounterGUI);
			}
			Object.Destroy((Object)(object)SoulsCounter);
			if ((Object)(object)((Component)data).gameObject.GetComponent<SoulstreakEffect>() != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)data).gameObject.GetComponent<SoulstreakEffect>());
			}
			InterfaceGameModeHooksManager.instance.RemoveHooks((object)this);
			HealthHandler healthHandler = data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive));
		}

		private void Update()
		{
			if (data.isPlaying)
			{
				foreach (ISoulstreakAbility ability in SoulstreakStats.Abilities)
				{
					ability.OnUpdate(this);
				}
			}
			((TMP_Text)SoulsCounter.GetComponent<TextMeshPro>()).text = SoulsString;
			if (data.view.IsMine && !((Behaviour)((Component)data).GetComponent<PlayerAPI>()).enabled)
			{
				((TMP_Text)SoulsCounterGUI.GetComponentInChildren<TextMeshProUGUI>()).text = SoulsString;
			}
		}
	}
}
namespace AALUND13Cards.Classes.MonoBehaviours.CardsEffects.Soulstreak.Abilities
{
	public class ArmorAbility : ISoulstreakAbility
	{
		public float AbilityCooldownTime;

		private float abilityCooldown;

		private bool abilityActive;

		private ArmorHandler armorHandler;

		public ArmorAbility(Player player, float abilityCooldownTime)
		{
			AbilityCooldownTime = abilityCooldownTime;
			abilityCooldown = 0f;
			abilityActive = false;
			armorHandler = ArmorFramework.ArmorHandlers[player];
		}

		public void OnBlock(SoulstreakMono soulstreak)
		{
			if (!abilityActive && abilityCooldown == 0f)
			{
				ArmorBase armorByType = armorHandler.GetArmorByType<SoulArmor>();
				armorByType.MaxArmorValue = soulstreak.Data.maxHealth * soulstreak.SoulstreakStats.SoulArmorPercentage * (float)(soulstreak.SoulstreakStats.Souls + 1);
				armorByType.ArmorRegenerationRate = armorByType.MaxArmorValue * soulstreak.SoulstreakStats.SoulArmorPercentageRegenRate;
				armorByType.CurrentArmorValue = armorByType.MaxArmorValue;
				abilityActive = true;
			}
		}

		public void OnReset(SoulstreakMono soulstreak)
		{
			abilityActive = false;
			abilityCooldown = 0f;
			ArmorBase armorByType = armorHandler.GetArmorByType<SoulArmor>();
			armorByType.MaxArmorValue = 0f;
			armorByType.CurrentArmorValue = 0f;
		}

		public void OnUpdate(SoulstreakMono soulstreak)
		{
			abilityCooldown = Mathf.Max(abilityCooldown - TimeHandler.deltaTime, 0f);
			if (armorHandler.GetArmorByType<SoulArmor>().CurrentArmorValue <= 0f && armorHandler.GetArmorByType<SoulArmor>().MaxArmorValue > 0f)
			{
				armorHandler.GetArmorByType<SoulArmor>().MaxArmorValue = 0f;
				abilityCooldown = 10f;
				abilityActive = false;
			}
		}
	}
	public interface ISoulstreakAbility
	{
		void OnBlock(SoulstreakMono soulstreak);

		void OnReset(SoulstreakMono soulstreak);

		void OnUpdate(SoulstreakMono soulstreak);
	}
}
namespace AALUND13Cards.Classes.MonoBehaviours.CardsEffects.Reaper
{
	public class BloodlustMono : MonoBehaviour, IOnDoDamageEvent
	{
		public float MaxBlood = 100f;

		public float StartingBlood = 50f;

		public float BloodDrainPerSecond = 2f;

		public float BloodDrainPerSecondRegen = 2f;

		public float BloodHealthRegenRate = 0.05f;

		public float BloodFillPerDamage = 50f;

		public float BloodDamageMultiplier = 0.25f;

		public float PercentageDamagePerDamage = 0.03f;

		private CharacterData data;

		private CustomHealthBar bloodBar;

		private float decayingPrecentageDamage;

		private float blood;

		private float appliedScaling;

		private float oldRegen;

		public void OnDamage(DamageInfo damage)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)data.player != (Object)(object)damage.DamagingPlayer))
			{
				float num = BloodFillPerDamage / PlayerExtensions.GetSPS(data.player);
				float num2 = PercentageDamagePerDamage / PlayerExtensions.GetSPS(data.player);
				decayingPrecentageDamage += num2;
				CharacterDataExtensions.GetCustomStatsRegistry(data).GetOrCreate<ReaperStats>().ScalingPercentageDamageUnCap += num2;
				appliedScaling += num2;
				if (blood < 0f)
				{
					blood = StartingBlood;
				}
				blood = Mathf.Min(MaxBlood, blood + num);
				LoggerUtils.LogInfo($"Gained {num} blood from damage, now at {blood}/{MaxBlood}");
			}
		}

		private void OnRevive()
		{
			blood = StartingBlood;
			CharacterDataExtensions.GetCustomStatsRegistry(data).GetOrCreate<ReaperStats>().ScalingPercentageDamageUnCap -= appliedScaling;
			appliedScaling = 0f;
			decayingPrecentageDamage = 0f;
		}

		private CustomHealthBar CreateStoredDamageBar()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Blood Bar");
			CustomHealthBar obj = val.AddComponent<CustomHealthBar>();
			obj.SetColor(new Color(0.66156864f, 0.043137256f, 0.043137256f, 1f) * 0.8f);
			ExtensionMethods.AddStatusIndicator(data.player, val, 0f, true);
			Object.Destroy((Object)(object)((Component)val.transform.Find("Healthbar(Clone)/Canvas/Image/White")).gameObject);
			return obj;
		}

		private void Update()
		{
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			float num = decayingPrecentageDamage;
			decayingPrecentageDamage = Mathf.Max(0f, decayingPrecentageDamage - decayingPrecentageDamage * decayingPrecentageDamage * 5f * Time.deltaTime);
			float num2 = decayingPrecentageDamage - num;
			CharacterDataExtensions.GetCustomStatsRegistry(data).GetOrCreate<ReaperStats>().ScalingPercentageDamageUnCap += num2;
			appliedScaling += num2;
			float num3 = BloodDrainPerSecond;
			if (data.health < data.maxHealth)
			{
				num3 += BloodDrainPerSecondRegen;
			}
			blood -= num3 * Time.deltaTime;
			if (blood <= 0f)
			{
				HealthHandler healthHandler = data.healthHandler;
				healthHandler.regeneration -= oldRegen;
				oldRegen = 0f;
				float num4 = data.maxHealth * ((0f - blood) * BloodDamageMultiplier) * Time.deltaTime;
				((Damagable)data.healthHandler).TakeDamage(Vector2.down * num4, Vector2.zero, (GameObject)null, (Player)null, true, true);
			}
			else if (blood > 0f && data.health < data.maxHealth)
			{
				float num5 = data.maxHealth * BloodHealthRegenRate;
				HealthHandler healthHandler2 = data.healthHandler;
				healthHandler2.regeneration -= oldRegen;
				HealthHandler healthHandler3 = data.healthHandler;
				healthHandler3.regeneration += num5;
				oldRegen = num5;
			}
			else if (oldRegen != 0f)
			{
				HealthHandler healthHandler4 = data.healthHandler;
				healthHandler4.regeneration -= oldRegen;
				oldRegen = 0f;
			}
			bloodBar.SetValues(blood, MaxBlood);
		}

		private void Start()
		{
			data = ((Component)this).GetComponentInParent<CharacterData>();
			bloodBar = CreateStoredDamageBar();
			HealthHandler healthHandler = data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive));
			DamageEventHandler.Instance.RegisterDamageEventForOtherPlayers((object)this, data.player);
		}

		private void OnDestroy()
		{
			Object.Destroy((Object)(object)((Component)bloodBar).gameObject);
			CharacterDataExtensions.GetCustomStatsRegistry(data).GetOrCreate<ReaperStats>().ScalingPercentageDamageUnCap -= appliedScaling;
			HealthHandler healthHandler = data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive));
			DamageEventHandler.Instance.UnregisterDamageEvent((object)this, data.player);
			if (oldRegen != 0f)
			{
				HealthHandler healthHandler2 = data.healthHandler;
				healthHandler2.regeneration -= oldRegen;
			}
		}
	}
}
namespace AALUND13Cards.Classes.MonoBehaviours.CardsEffects.ExoArmor
{
	public class ExoArmorDamageReductionAdder : MonoBehaviour
	{
		public float DamageReduction;

		private ArmorHandler armorHandler;

		private float addedArmorDamageReduction;

		private void Awake()
		{
			armorHandler = ((Component)this).GetComponentInParent<ArmorHandler>();
			float armorDamageReduction = ((AALUND13Cards.Classes.Armors.ExoArmor)(object)armorHandler.GetArmorByType<AALUND13Cards.Classes.Armors.ExoArmor>()).ArmorDamageReduction;
			if (addedArmorDamageReduction > 0f)
			{
				addedArmorDamageReduction = Mathf.Max(Mathf.Min(armorDamageReduction + DamageReduction, 0.8f) - armorDamageReduction, 0f);
			}
			else
			{
				addedArmorDamageReduction = DamageReduction;
			}
			((AALUND13Cards.Classes.Armors.ExoArmor)(object)armorHandler.GetArmorByType<AALUND13Cards.Classes.Armors.ExoArmor>()).ArmorDamageReduction += addedArmorDamageReduction;
		}

		private void OnDestroy()
		{
			((AALUND13Cards.Classes.Armors.ExoArmor)(object)armorHandler.GetArmorByType<AALUND13Cards.Classes.Armors.ExoArmor>()).ArmorDamageReduction -= addedArmorDamageReduction;
		}
	}
	public class ExoArmorReflectChanceAdder : MonoBehaviour
	{
		public float ReflectChance;

		private ArmorHandler armorHandler;

		private float addedArmorReflectChance;

		private void Awake()
		{
			armorHandler = ((Component)this).GetComponentInParent<ArmorHandler>();
			AALUND13Cards.Classes.Armors.ExoArmor exoArmor = (AALUND13Cards.Classes.Armors.ExoArmor)(object)armorHandler.GetArmorByType<AALUND13Cards.Classes.Armors.ExoArmor>();
			addedArmorReflectChance = Mathf.Max(Mathf.Min(exoArmor.ReflectChance + ReflectChance, 0.8f) - exoArmor.ReflectChance, 0f);
			exoArmor.ReflectChance += addedArmorReflectChance;
		}

		private void OnDestroy()
		{
			((AALUND13Cards.Classes.Armors.ExoArmor)(object)armorHandler.GetArmorByType<AALUND13Cards.Classes.Armors.ExoArmor>()).ReflectChance -= addedArmorReflectChance;
		}
	}
	public class ExoArmorSpawnDamageEffect : MonoBehaviour
	{
		private DamageSpawnObjects damageSpawnObjects;

		private ArmorHandler armorHandler;

		private void Awake()
		{
			damageSpawnObjects = ((Component)this).GetComponent<DamageSpawnObjects>();
			armorHandler = ((Component)this).GetComponentInParent<ArmorHandler>();
			AALUND13Cards.Classes.Armors.ExoArmor obj = (AALUND13Cards.Classes.Armors.ExoArmor)(object)armorHandler.GetArmorByType<AALUND13Cards.Classes.Armors.ExoArmor>();
			obj.OnArmorDamaged = (Action<float>)Delegate.Combine(obj.OnArmorDamaged, new Action<float>(OnArmorDamaged));
		}

		private void OnDestroy()
		{
			AALUND13Cards.Classes.Armors.ExoArmor obj = (AALUND13Cards.Classes.Armors.ExoArmor)(object)armorHandler.GetArmorByType<AALUND13Cards.Classes.Armors.ExoArmor>();
			obj.OnArmorDamaged = (Action<float>)Delegate.Remove(obj.OnArmorDamaged, new Action<float>(OnArmorDamaged));
		}

		private void OnArmorDamaged(float damage)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			damageSpawnObjects.SpawnDamage(Vector2.up * damage);
		}
	}
}
namespace AALUND13Cards.Classes.Cards
{
	public class RailgunStats : ICustomStats
	{
		public struct RailgunChargeStats
		{
			public float ChargeDamageMultiplier;

			public float ChargeBulletSpeedMultiplier;

			public RailgunChargeStats(float chargeDamageMultiplier, float chargeBulletSpeedMultiplier)
			{
				ChargeDamageMultiplier = chargeDamageMultiplier;
				ChargeBulletSpeedMultiplier = chargeBulletSpeedMultiplier;
			}
		}

		public bool IsEnabled;

		public bool AllowOvercharge;

		public float MaximumCharge;

		public float CurrentCharge;

		public float ChargeRate;

		public float FullChargeThreshold = 20f;

		public float RailgunDamageMultiplier = 1f;

		public float RailgunBulletSpeedMultiplier = 1f;

		public float RailgunMinimumChargeDamageMultiplier = 0.25f;

		public float RailgunMinimumChargeBulletSpeedMultiplier = 0.5f;

		public RailgunChargeStats GetChargeStats(float charge)
		{
			float num = charge;
			num = (AllowOvercharge ? (num / 2f) : Mathf.Min(num, FullChargeThreshold));
			float num2 = num / FullChargeThreshold;
			float chargeDamageMultiplier = RailgunMinimumChargeDamageMultiplier + (RailgunDamageMultiplier - RailgunMinimumChargeDamageMultiplier) * num2;
			float chargeBulletSpeedMultiplier = RailgunMinimumChargeBulletSpeedMultiplier + (RailgunBulletSpeedMultiplier - RailgunMinimumChargeBulletSpeedMultiplier) * num2;
			return new RailgunChargeStats(chargeDamageMultiplier, chargeBulletSpeedMultiplier);
		}

		public void UseCharge(RailgunStats stats)
		{
			if (AllowOvercharge)
			{
				CurrentCharge = 0f;
			}
			else
			{
				CurrentCharge = Mathf.Max(CurrentCharge - FullChargeThreshold, 0f);
			}
			AllowOvercharge = false;
		}

		public void ResetStats()
		{
			IsEnabled = false;
			AllowOvercharge = false;
			MaximumCharge = 0f;
			CurrentCharge = 0f;
			ChargeRate = 0f;
			FullChargeThreshold = 20f;
			RailgunDamageMultiplier = 1f;
			RailgunBulletSpeedMultiplier = 1f;
			RailgunMinimumChargeDamageMultiplier = 0.25f;
			RailgunMinimumChargeBulletSpeedMultiplier = 0.5f;
		}
	}
	public class ReaperStats : ICustomStats
	{
		public float ScalingPercentageDamage;

		public float ScalingPercentageDamageUnCap;

		public float ScalingPercentageDamageCap;

		public void ResetStats()
		{
			ScalingPercentageDamage = 0f;
			ScalingPercentageDamageUnCap = 0f;
			ScalingPercentageDamageCap = 0f;
		}
	}
	public class SoulStreakStats : ICustomStats
	{
		public float MaxHealth = 1f;

		public float PlayerSize = 1f;

		public float MovementSpeed = 1f;

		public float AttackSpeed = 1f;

		public float Damage = 1f;

		public float BulletSpeed = 1f;

		public float SoulArmorPercentage;

		public float SoulArmorPercentageRegenRate;

		public float SoulDrainDPSFactor;

		public float SoulDrainLifestealMultiply;

		public List<ISoulstreakAbility> Abilities = new List<ISoulstreakAbility>();

		public uint Souls;

		public void ResetStats()
		{
			MaxHealth = 1f;
			PlayerSize = 1f;
			MovementSpeed = 1f;
			AttackSpeed = 1f;
			Damage = 1f;
			BulletSpeed = 1f;
			SoulArmorPercentage = 0f;
			SoulArmorPercentageRegenRate = 0f;
			Abilities.Clear();
		}
	}
}
namespace AALUND13Cards.Classes.Cards.StatModifers
{
	public class RailgunStatModifers : CustomStatModifers
	{
		[Header("Railgun Stats Add")]
		public float MaximumCharge;

		public float ChargeRate;

		[Header("Railgun Stats Multiplier")]
		public float MaximumChargeMultiplier = 1f;

		public float ChargeRateMultiplier = 1f;

		public float RailgunDamageMultiplier = 1f;

		public float RailgunBulletSpeedMultiplier = 1f;

		public override void Apply(Player player)
		{
			RailgunStats orCreate = CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<RailgunStats>();
			orCreate.MaximumCharge = Mathf.Max(orCreate.MaximumCharge + MaximumCharge, 0f);
			orCreate.ChargeRate = Mathf.Max(orCreate.ChargeRate + ChargeRate, 0f);
			orCreate.MaximumCharge *= MaximumChargeMultiplier;
			orCreate.ChargeRate *= ChargeRateMultiplier;
			orCreate.RailgunDamageMultiplier += RailgunDamageMultiplier - 1f;
			orCreate.RailgunBulletSpeedMultiplier += RailgunBulletSpeedMultiplier - 1f;
		}
	}
	public class ReaperStatModifers : CustomStatModifers
	{
		[Header("Percentage Damage")]
		public float ScalingPercentageDamage;

		public float ScalingPercentageDamageCap;

		public override void Apply(Player player)
		{
			ReaperStats orCreate = CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<ReaperStats>();
			orCreate.ScalingPercentageDamageCap += ScalingPercentageDamageCap;
			orCreate.ScalingPercentageDamage += ScalingPercentageDamage;
		}
	}
	[Flags]
	public enum AbilityType
	{
		Armor = 1
	}
	public class SoulstreakStatModifers : CustomStatModifers
	{
		[Header("Character Stats")]
		public float MaxHealth;

		public float PlayerSize;

		public float MovementSpeed;

		public float AttackSpeed;

		public float Damage;

		public float BulletSpeed;

		[Header("Soul Armor")]
		public float SoulArmorPercentage;

		public float SoulArmorPercentageRegenRate;

		[Header("Soul Drain")]
		public float SoulDrainDamageMultiply;

		public float SoulDrainLifestealMultiply;

		[Header("Abilities")]
		public AbilityType AbilityType;

		public override void Apply(Player player)
		{
			SoulStreakStats orCreate = CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<SoulStreakStats>();
			orCreate.MaxHealth += MaxHealth;
			orCreate.PlayerSize += PlayerSize;
			orCreate.MovementSpeed += MovementSpeed;
			orCreate.AttackSpeed += AttackSpeed;
			orCreate.Damage += Damage;
			orCreate.BulletSpeed += BulletSpeed;
			orCreate.SoulArmorPercentage += SoulArmorPercentage;
			orCreate.SoulArmorPercentageRegenRate += SoulArmorPercentageRegenRate;
			orCreate.SoulDrainDPSFactor += SoulDrainDamageMultiply;
			orCreate.SoulDrainLifestealMultiply += SoulDrainLifestealMultiply;
			if ((AbilityType & AbilityType.Armor) == AbilityType.Armor)
			{
				orCreate.Abilities.Add(new ArmorAbility(player, 10f));
			}
		}
	}
}
namespace AALUND13Cards.Classes.Cards.Conditions
{
	public class MentPercentageDamageCondition : CardCondition
	{
		public override bool IsPlayerAllowedCard(Player player)
		{
			return CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<ReaperStats>().ScalingPercentageDamage < CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<ReaperStats>().ScalingPercentageDamageCap;
		}
	}
}
namespace AALUND13Cards.Classes.Armors
{
	public class ExoArmor : ArmorBase
	{
		private static Dictionary<Player, bool[]> ReflectChances = new Dictionary<Player, bool[]>();

		private static Dictionary<Player, int> ReflectIndex = new Dictionary<Player, int>();

		public Action<float> OnArmorDamaged;

		public float ArmorDamageReduction;

		public float ReflectChance;

		private float queuedDamage;

		public override BarColor GetBarColor()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//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)
			return new BarColor(Color.cyan * 0.6f, Color.cyan * 0.45f);
		}

		public override DamageArmorInfo OnDamage(float damage, Player DamagingPlayer, ArmorDamagePatchType? armorDamagePatchType)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			queuedDamage += damage;
			float num = damage * (1f - ArmorDamageReduction);
			return ((ArmorBase)this).OnDamage(num, DamagingPlayer, armorDamagePatchType);
		}

		public override void OnUpdate()
		{
			if (queuedDamage > 0f)
			{
				OnArmorDamaged?.Invoke(queuedDamage);
				queuedDamage = 0f;
			}
		}

		public override void OnRespawn()
		{
			queuedDamage = 0f;
			if (PhotonNetwork.IsMasterClient)
			{
				bool[] array = new bool[10000];
				for (int i = 0; i < 10000; i++)
				{
					array[i] = Random.value < ReflectChance;
				}
				NetworkingManager.RPC(typeof(ExoArmor), "ArmorReflectOddsRPCA", new object[2]
				{
					((ArmorBase)this).ArmorHandler.Player.playerID,
					array
				});
			}
		}

		public bool Reflect(float bulletDmage)
		{
			if (ReflectIndex.TryGetValue(((ArmorBase)this).ArmorHandler.Player, out var value) && value < 10000)
			{
				((ArmorBase)this).DamageArmor(bulletDmage / 2f);
				ReflectIndex[((ArmorBase)this).ArmorHandler.Player]++;
				return ReflectChances[((ArmorBase)this).ArmorHandler.Player][value];
			}
			return false;
		}

		public ExoArmor()
		{
			base.ArmorTags.Add("CanArmorPierce");
		}

		[UnboundRPC]
		public static void ArmorReflectOddsRPCA(int playerId, bool[] bools)
		{
			Player key = PlayerManager.instance.players.Find((Player p) => p.playerID == playerId);
			_ = (ExoArmor)(object)ArmorFramework.ArmorHandlers[key].GetArmorByType<ExoArmor>();
			if (!ReflectChances.ContainsKey(key))
			{
				ReflectChances.Add(key, bools);
				ReflectIndex.Add(key, 0);
			}
			else
			{
				ReflectChances[key] = bools;
				ReflectIndex[key] = 0;
			}
		}
	}
	public class SoulArmor : ArmorBase
	{
		public override BarColor GetBarColor()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//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)
			return new BarColor(Color.magenta * 0.6f, Color.magenta * 0.45f);
		}

		public SoulArmor()
		{
			base.ArmorRegenCooldownSeconds = 5f;
		}
	}
}
namespace AALUND13Cards.ExtraCards
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("AALUND13.Cards.Classes", "AALUND13 Classes Cards", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	internal class AAC_Classes : BaseUnityPlugin
	{
		[CompilerGenerated]
		private sealed class <OnGameStart>d__6 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

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

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

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

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

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				foreach (Player player in PlayerManager.instance.players)
				{
					CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<SoulStreakStats>().Souls = 0u;
				}
				return false;
			}

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

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

		internal const string ModId = "AALUND13.Cards.Classes";

		internal const string ModName = "AALUND13 Classes Cards";

		internal const string Version = "1.0.0";

		private static AssetBundle assets;

		private void Awake()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			assets = AssetUtils.LoadAssetBundleFromResources("aac_classes_assets", typeof(AAC_Classes).Assembly);
			if ((Object)(object)assets != (Object)null)
			{
				new Harmony("AALUND13.Cards.Classes").PatchAll();
			}
		}

		private void Start()
		{
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			if ((Object)(object)assets == (Object)null)
			{
				Unbound.BuildModal("AALUND13 Cards Error", "The mod \"AALUND13 Classes Cards\" assets failled to load, All the cards will be disable in this mod");
				throw new NullReferenceException("Failled to load \"AALUND13 Classes Cards\" assets");
			}
			if (AAC_Core.Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "com.willuwontu.rounds.tabinfo"))
			{
				TabinfoInterface.Setup();
			}
			if (AAC_Core.Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "AALUND13.Cards.Armors"))
			{
				ArmorInterface.RegisterArmors();
			}
			assets.LoadAsset<GameObject>("ClassesModCards").GetComponent<CardResgester>().RegisterCards();
			DeathHandler.OnPlayerDeath += new DeathHandlerDelegate(OnPlayerDeath);
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)OnGameStart);
		}

		[IteratorStateMachine(typeof(<OnGameStart>d__6))]
		private IEnumerator OnGameStart(IGameModeHandler gameModeHandler)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnGameStart>d__6(0);
		}

		private void OnPlayerDeath(Player player, Dictionary<Player, DamageInfo> playerDamageInfos)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			foreach (KeyValuePair<Player, DamageInfo> playerDamageInfo in playerDamageInfos)
			{
				if (playerDamageInfo.Value.TimeSinceLastDamage <= 5f && (Object)(object)((Component)playerDamageInfo.Key).GetComponentInChildren<SoulstreakMono>() != (Object)null && !playerDamageInfo.Key.data.dead)
				{
					((Component)playerDamageInfo.Key).GetComponentInChildren<SoulstreakMono>().AddSouls();
					if ((Object)(object)((Component)player).GetComponentInChildren<SoulstreakMono>() != (Object)null)
					{
						((Component)playerDamageInfo.Key).GetComponentInChildren<SoulstreakMono>().AddSouls((uint)((float)CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<SoulStreakStats>().Souls * 0.5f));
					}
				}
			}
			((Component)player).GetComponentInChildren<SoulstreakMono>()?.ResetSouls();
			if ((Object)(object)((Component)player).GetComponentInChildren<SoulstreakMono>() == (Object)null)
			{
				CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<SoulStreakStats>().Souls = 0u;
			}
		}
	}
	internal class TabinfoInterface
	{
		public static void Setup()
		{
			StatCategory orCreateCategory = TabinfoInterface.GetOrCreateCategory("AA Stats", 6);
			TabInfoManager.RegisterStat(orCreateCategory, "Scaling Percentage Damage", (Func<Player, bool>)((Player p) => GetReaperStatsFromPlayer(p).ScalingPercentageDamage != 0f), (Func<Player, string>)((Player p) => $"{(Mathf.Min(GetReaperStatsFromPlayer(p).ScalingPercentageDamage, Mathf.Min(GetReaperStatsFromPlayer(p).ScalingPercentageDamageCap, 0.8f)) + GetReaperStatsFromPlayer(p).ScalingPercentageDamageUnCap) * 100f:0}%"));
			TabInfoManager.RegisterStat(orCreateCategory, "Effective Percentage Damage", (Func<Player, bool>)((Player p) => GetReaperStatsFromPlayer(p).ScalingPercentageDamage != 0f), (Func<Player, string>)((Player p) => $"{(MathUtils.GetEffectivePercentCap(PlayerExtensions.GetSPS(p), GetReaperStatsFromPlayer(p).ScalingPercentageDamage, GetReaperStatsFromPlayer(p).ScalingPercentageDamageCap) + MathUtils.GetEffectivePercent(PlayerExtensions.GetSPS(p), GetReaperStatsFromPlayer(p).ScalingPercentageDamageUnCap)) * 100f:0}%"));
			StatCategory obj = TabInfoManager.RegisterCategory("Soulstreak Stats", 7);
			TabInfoManager.RegisterStat(obj, "Max Health Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).MaxHealth != 0f), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).MaxHealth * 100f:0}%"));
			TabInfoManager.RegisterStat(obj, "player Size Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).PlayerSize != 0f), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).PlayerSize * 100f:0}%"));
			TabInfoManager.RegisterStat(obj, "Movement Speed Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).MovementSpeed != 0f), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).MovementSpeed * 100f:0}%"));
			TabInfoManager.RegisterStat(obj, "Attack Speed Pre Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).AttackSpeed != 0f), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).AttackSpeed * 100f:0}%"));
			TabInfoManager.RegisterStat(obj, "Damage Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).Damage != 0f), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).Damage * 100f:0}%"));
			TabInfoManager.RegisterStat(obj, "Bullet Speed Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).BulletSpeed != 0f), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).BulletSpeed * 100f:0}%"));
			TabInfoManager.RegisterStat(obj, "Soul Armor Percentage", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).SoulArmorPercentage != 0f), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).SoulArmorPercentage * 100f:0}%"));
			TabInfoManager.RegisterStat(obj, "Soul Armor Percentage Regen Rate", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).SoulArmorPercentageRegenRate != 0f), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).SoulArmorPercentageRegenRate * 100f:0}%"));
			TabInfoManager.RegisterStat(obj, "Soul Drain DPS Factor", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).SoulDrainDPSFactor != 0f), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).SoulDrainDPSFactor * 100f:0}%"));
			TabInfoManager.RegisterStat(obj, "Souls", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && GetSoulstreakStatsFromPlayer(p).Souls != 0), (Func<Player, string>)((Player p) => $"{GetSoulstreakStatsFromPlayer(p).Souls}"));
			StatCategory obj2 = TabInfoManager.RegisterCategory("Railgun Stats", 8);
			TabInfoManager.RegisterStat(obj2, "Charge", (Func<Player, bool>)((Player p) => GetRailgunStatsFromPlayer(p).IsEnabled && GetRailgunStatsFromPlayer(p).MaximumCharge != 0f), (Func<Player, string>)((Player p) => $"{GetRailgunStatsFromPlayer(p).CurrentCharge:0.00}/{GetRailgunStatsFromPlayer(p).MaximumCharge:0.00}"));
			TabInfoManager.RegisterStat(obj2, "Charge Rate", (Func<Player, bool>)((Player p) => GetRailgunStatsFromPlayer(p).IsEnabled && GetRailgunStatsFromPlayer(p).ChargeRate != 0f), (Func<Player, string>)((Player p) => $"{GetRailgunStatsFromPlayer(p).ChargeRate:0.00}/s"));
			TabInfoManager.RegisterStat(obj2, "Railgun Damage Multiplier", (Func<Player, bool>)((Player p) => GetRailgunStatsFromPlayer(p).IsEnabled && GetRailgunStatsFromPlayer(p).RailgunDamageMultiplier != 1f), (Func<Player, string>)((Player p) => $"{GetRailgunStatsFromPlayer(p).RailgunDamageMultiplier * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Railgun Bullet Speed Multiplier", (Func<Player, bool>)((Player p) => GetRailgunStatsFromPlayer(p).IsEnabled && GetRailgunStatsFromPlayer(p).RailgunBulletSpeedMultiplier != 1f), (Func<Player, string>)((Player p) => $"{GetRailgunStatsFromPlayer(p).RailgunBulletSpeedMultiplier * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Railgun Full Charge Threshold", (Func<Player, bool>)((Player p) => GetRailgunStatsFromPlayer(p).IsEnabled && GetRailgunStatsFromPlayer(p).FullChargeThreshold != 0f), (Func<Player, string>)((Player p) => $"{GetRailgunStatsFromPlayer(p).FullChargeThreshold:0.00}"));
		}

		private static RailgunStats GetRailgunStatsFromPlayer(Player player)
		{
			return CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<RailgunStats>();
		}

		private static SoulStreakStats GetSoulstreakStatsFromPlayer(Player player)
		{
			return CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<SoulStreakStats>();
		}

		private static ReaperStats GetReaperStatsFromPlayer(Player player)
		{
			return CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<ReaperStats>();
		}
	}
}

plugins/AALUND13_Curses_Cards.dll

Decompiled 3 days 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 AALUND13Cards.Core;
using AALUND13Cards.Core.Cards;
using AALUND13Cards.Core.Extensions;
using AALUND13Cards.Core.Handlers;
using AALUND13Cards.Core.Utils;
using AALUND13Cards.Curses.Cards;
using AALUND13Cards.Curses.MonoBehaviours;
using BepInEx;
using HarmonyLib;
using InControl;
using JARL.Utils;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.GameModes;
using ModdingUtils.Utils;
using Photon.Pun;
using TabInfo.Utils;
using UnboundLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[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]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AALUND13Cards.Core.MonoBehaviours.CardsEffects
{
	public class ReverseLifeSteelEffect : MonoBehaviour, IOnDoDamageEvent
	{
		public float ReverseLifeSteelPercentage = 0.2f;

		private Player player;

		public void OnDamage(DamageInfo damage)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)damage.DamagingPlayer != (Object)null)
			{
				damage.DamagingPlayer.data.healthHandler.Heal(((Vector2)(ref damage.Damage)).magnitude * ReverseLifeSteelPercentage);
			}
		}

		private void Start()
		{
			player = ((Component)this).GetComponentInParent<Player>();
			DamageEventHandler.Instance.RegisterDamageEvent((object)this, player);
		}

		private void OnDestroy()
		{
			DamageEventHandler.Instance.UnregisterDamageEvent((object)this, player);
		}
	}
}
namespace AALUND13Cards.Core.Cards.Effects
{
	public class AddPostProcessingEffect : OnAddedEffect
	{
		public List<Material> PostProcessingEffects = new List<Material>();

		public override void OnAdded(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (!player.data.view.IsMine)
			{
				return;
			}
			Camera main = Camera.main;
			if (!((Object)(object)main != (Object)null))
			{
				return;
			}
			foreach (Material postProcessingEffect in PostProcessingEffects)
			{
				((Component)main).gameObject.AddComponent<PostProcessingEffect>().Material = postProcessingEffect;
			}
		}
	}
}
namespace AALUND13Cards.Curses
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("AALUND13.Cards.Curses", "AALUND13 Curses Cards", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	internal class AAC_Curses : BaseUnityPlugin
	{
		internal const string ModId = "AALUND13.Cards.Curses";

		internal const string ModName = "AALUND13 Curses Cards";

		internal const string Version = "1.0.0";

		private static AssetBundle assets;

		private void Awake()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			assets = AssetUtils.LoadAssetBundleFromResources("aac_curses_assets", typeof(AAC_Curses).Assembly);
			if ((Object)(object)assets != (Object)null)
			{
				new Harmony("AALUND13.Cards.Curses").PatchAll();
			}
		}

		private void Start()
		{
			if ((Object)(object)assets == (Object)null)
			{
				Unbound.BuildModal("AALUND13 Cards Error", "The mod \"AALUND13 Curses Cards\" assets failled to load, All the cards will be disable in this mod");
				throw new NullReferenceException("Failled to load \"AALUND13 Curses Cards\" assets");
			}
			if (AAC_Core.Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "com.willuwontu.rounds.tabinfo"))
			{
				TabinfoInterface.Setup();
			}
			Object.DontDestroyOnLoad((Object)(object)Object.Instantiate<GameObject>(assets.LoadAsset<GameObject>("FlashlightMaskHandler")));
			assets.LoadAsset<GameObject>("CursesModCards").GetComponent<CardResgester>().RegisterCards();
			assets.LoadAsset<GameObject>("CursesPhotonPrefabPool").GetComponent<PhotonPrefabPool>().RegisterPrefabs();
		}
	}
	internal class TabinfoInterface
	{
		public static void Setup()
		{
			StatCategory orCreateCategory = TabinfoInterface.GetOrCreateCategory("AA Stats", 6);
			TabInfoManager.RegisterStat(orCreateCategory, "Is Bind", (Func<Player, bool>)((Player p) => GetCursesStatsFromPlayer(p).IsBind), (Func<Player, string>)((Player p) => (!GetCursesStatsFromPlayer(p).IsBind) ? "No" : "Yes"));
			TabInfoManager.RegisterStat(orCreateCategory, "Is Decay Time Disable", (Func<Player, bool>)((Player p) => GetCursesStatsFromPlayer(p).DisableDecayTime), (Func<Player, string>)((Player p) => (!GetCursesStatsFromPlayer(p).DisableDecayTime) ? "No" : "Yes"));
		}

		private static CursesStats GetCursesStatsFromPlayer(Player player)
		{
			return CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<CursesStats>();
		}
	}
}
namespace AALUND13Cards.Curses.Patches
{
	[HarmonyPatch(typeof(CharacterStatModifiers))]
	public class CharacterStatModifiersPatch
	{
		[HarmonyPatch("ResetStats")]
		[HarmonyPrefix]
		public static void ResetStats(CharacterStatModifiers __instance)
		{
			//IL_0015: 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_0020: Expected O, but got Unknown
			CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue();
			CharacterDataExtensions.GetAdditionalData(val).Reset();
			if (!val.view.IsMine)
			{
				return;
			}
			Camera main = Camera.main;
			if ((Object)(object)main != (Object)null)
			{
				PostProcessingEffect[] components = ((Component)main).GetComponents<PostProcessingEffect>();
				for (int i = 0; i < components.Length; i++)
				{
					Object.Destroy((Object)(object)components[i]);
				}
			}
		}
	}
	[HarmonyPatch(typeof(DamageOverTime))]
	public class DamageOverTimePatch
	{
		[HarmonyPatch("TakeDamageOverTime")]
		[HarmonyPrefix]
		public static bool TakeDamageOverTimePrefix(DamageOverTime __instance, Vector2 damage, Vector2 position, float time, float interval, Color color, GameObject damagingWeapon, Player damagingPlayer, bool lethal)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue();
			if (CharacterDataExtensions.GetAdditionalData(val).CustomStatsRegistry.GetOrCreate<CursesStats>().DisableDecayTime)
			{
				val.healthHandler.DoDamage(damage, position, color, damagingWeapon, damagingPlayer, true, lethal, false);
				return false;
			}
			return true;
		}
	}
}
namespace AALUND13Cards.Curses.MonoBehaviours
{
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	public class PostProcessingEffect : MonoBehaviour
	{
		public Material Material;

		private void OnRenderImage(RenderTexture src, RenderTexture dest)
		{
			if ((Object)(object)Material == (Object)null)
			{
				Graphics.Blit((Texture)(object)src, dest);
				return;
			}
			RenderTexture temporary = RenderTexture.GetTemporary(((Texture)src).width, ((Texture)src).height);
			Graphics.Blit((Texture)(object)src, temporary, Material, 0);
			Graphics.Blit((Texture)(object)temporary, dest);
			RenderTexture.ReleaseTemporary(temporary);
		}
	}
}
namespace AALUND13Cards.Curses.MonoBehaviours.CardsEffects
{
	public class AddPostProcessingEffectInRounds : MonoBehaviour, IRoundStartHookHandler, IRoundEndHookHandler
	{
		public List<Material> PostProcessingEffects = new List<Material>();

		private List<PostProcessingEffect> addedEffects = new List<PostProcessingEffect>();

		private CharacterData characterData;

		public void OnRoundEnd()
		{
			foreach (PostProcessingEffect addedEffect in addedEffects)
			{
				((Behaviour)addedEffect).enabled = false;
			}
		}

		public void OnRoundStart()
		{
			foreach (PostProcessingEffect addedEffect in addedEffects)
			{
				((Behaviour)addedEffect).enabled = true;
			}
		}

		private void Start()
		{
			characterData = ((Component)this).GetComponentInParent<CharacterData>();
			Camera main = Camera.main;
			if ((Object)(object)main != (Object)null && characterData.view.IsMine)
			{
				foreach (Material postProcessingEffect2 in PostProcessingEffects)
				{
					PostProcessingEffect postProcessingEffect = ((Component)main).gameObject.AddComponent<PostProcessingEffect>();
					postProcessingEffect.Material = postProcessingEffect2;
					((Behaviour)postProcessingEffect).enabled = false;
					addedEffects.Add(postProcessingEffect);
				}
			}
			InterfaceGameModeHooksManager.instance.RegisterHooks((object)this);
		}

		private void OnDestroy()
		{
			foreach (PostProcessingEffect addedEffect in addedEffects)
			{
				Object.Destroy((Object)(object)addedEffect);
			}
			InterfaceGameModeHooksManager.instance.RemoveHooks((object)this);
		}
	}
	public class HealingRadiance : MonoBehaviour
	{
		public float healingAmount = 10f;

		private CharacterData data;

		private bool effectActive;

		private void Start()
		{
			data = ((Component)this).GetComponentInParent<CharacterData>();
		}

		private void Update()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//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)
			if (!(data.input.direction == Vector3.zero) && !(data.input.direction == Vector3.down))
			{
				return;
			}
			foreach (Player enemyPlayer in PlayerStatus.GetEnemyPlayers(data.player))
			{
				enemyPlayer.data.healthHandler.Heal(healingAmount * TimeHandler.deltaTime);
			}
		}
	}
	public class LifeLinkedAdder : MonoBehaviour
	{
		public GameObject LifeLinkPrefab;

		private GameObject instantiatedLifeLink;

		private void Start()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			Player componentInParent = ((Component)this).gameObject.GetComponentInParent<Player>();
			if (componentInParent.data.view.IsMine)
			{
				Player random = ExtensionMethods.GetRandom<Player>((IList)PlayerStatus.GetOtherPlayers(componentInParent));
				instantiatedLifeLink = PhotonNetwork.Instantiate(((Object)LifeLinkPrefab).name, Vector3.zero, Quaternion.identity, (byte)0, new object[2] { componentInParent.playerID, random.playerID });
			}
		}

		private void OnDestroy()
		{
			if ((Object)(object)instantiatedLifeLink != (Object)null)
			{
				PhotonNetwork.Destroy(instantiatedLifeLink);
			}
		}
	}
	[RequireComponent(typeof(PhotonView))]
	public class LifeLinkMono : MonoBehaviour, IPunInstantiateMagicCallback
	{
		[CompilerGenerated]
		private sealed class <LinkedDeath>d__10 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public LifeLinkMono <>4__this;

			private Vector2 <oldPosition>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002d: 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_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: 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_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				//IL_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0103: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				LifeLinkMono lifeLinkMono = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<oldPosition>5__2 = Vector2.op_Implicit(lifeLinkMono.LinkTargetTwo.transform.position);
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (lifeLinkMono.lineTurnBackAmount > 0f)
				{
					lifeLinkMono.lineTurnBackAmount -= Time.deltaTime * 2f;
					Vector2 val = Vector2.Lerp(<oldPosition>5__2, Vector2.op_Implicit(((Component)lifeLinkMono.player).transform.position), 1f - lifeLinkMono.lineTurnBackAmount);
					lifeLinkMono.LinkTargetTwo.transform.position = Vector2.op_Implicit(val);
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				lifeLinkMono.LineRenderer.gameObject.SetActive(false);
				if (lifeLinkMono.player.data.view.IsMine)
				{
					lifeLinkMono.player.data.view.RPC("RPCA_Die", (RpcTarget)0, new object[1] { Vector2.down });
				}
				lifeLinkMono.player.data.health = 0f;
				return false;
			}

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

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

		public GameObject LinkTargetOne;

		public GameObject LinkTargetTwo;

		public GameObject LineRenderer;

		private Player player;

		private Player linkedPlayer;

		private float lineTurnBackAmount = 1f;

		private bool linkedDeathStarted;

		public void OnPhotonInstantiate(PhotonMessageInfo info)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			object[] instantiationData = info.photonView.InstantiationData;
			int playerId = (int)instantiationData[0];
			int linkedPlayerId = (int)instantiationData[1];
			player = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == playerId));
			linkedPlayer = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == linkedPlayerId));
			DeathHandler.OnPlayerDeath += new DeathHandlerDelegate(OnDeath);
			HealthHandler healthHandler = linkedPlayer.data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive));
			HealthHandler healthHandler2 = player.data.healthHandler;
			healthHandler2.reviveAction = (Action)Delegate.Combine(healthHandler2.reviveAction, new Action(OnRevive));
		}

		private void OnDeath(Player player, Dictionary<Player, DamageInfo> playerDamageInfos)
		{
			ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)this, 1, (Action)delegate
			{
				if (!player.data.healthHandler.isRespawning)
				{
					if ((Object)(object)player == (Object)(object)linkedPlayer)
					{
						if (!linkedDeathStarted)
						{
							linkedDeathStarted = true;
							((MonoBehaviour)this).StartCoroutine(LinkedDeath());
						}
					}
					else if ((Object)(object)player == (Object)(object)this.player)
					{
						linkedDeathStarted = true;
						lineTurnBackAmount = 0f;
						LineRenderer.gameObject.SetActive(false);
					}
				}
			});
		}

		private void OnRevive()
		{
			if (!player.data.dead && !linkedPlayer.data.dead)
			{
				linkedDeathStarted = false;
				lineTurnBackAmount = 1f;
				LineRenderer.gameObject.SetActive(true);
			}
		}

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

		private void Update()
		{
			//IL_0033: 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)
			if (!((Object)(object)player == (Object)null) && !((Object)(object)linkedPlayer == (Object)null))
			{
				LinkTargetOne.transform.position = ((Component)player).transform.position;
				if (!linkedDeathStarted)
				{
					LinkTargetTwo.transform.position = ((Component)linkedPlayer).transform.position;
				}
			}
		}

		private void OnDestroy()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			if ((Object)(object)player != (Object)null)
			{
				DeathHandler.OnPlayerDeath -= new DeathHandlerDelegate(OnDeath);
				HealthHandler healthHandler = player.data.healthHandler;
				healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive));
			}
			if ((Object)(object)linkedPlayer != (Object)null)
			{
				HealthHandler healthHandler2 = linkedPlayer.data.healthHandler;
				healthHandler2.reviveAction = (Action)Delegate.Remove(healthHandler2.reviveAction, new Action(OnRevive));
			}
		}
	}
	public class SwapBlockAndFireEffect : MonoBehaviour
	{
		private CharacterData CharacterData;

		private PlayerActions PlayerActions;

		private List<BindingSource> blockBindingSources;

		private List<BindingSource> fireBindingSources;

		private void Start()
		{
			CharacterData = ((Component)this).GetComponentInParent<CharacterData>();
			PlayerActions = CharacterData.playerActions;
			blockBindingSources = PlayerActions.Block.Bindings.ToList();
			fireBindingSources = PlayerActions.Fire.Bindings.ToList();
			foreach (BindingSource blockBindingSource in blockBindingSources)
			{
				_ = blockBindingSource;
				PlayerActions.Block.ClearBindings();
			}
			foreach (BindingSource fireBindingSource in fireBindingSources)
			{
				_ = fireBindingSource;
				PlayerActions.Fire.ClearBindings();
			}
			foreach (BindingSource blockBindingSource2 in blockBindingSources)
			{
				_ = blockBindingSource2;
				foreach (BindingSource fireBindingSource2 in fireBindingSources)
				{
					PlayerActions.Block.AddBinding(fireBindingSource2);
				}
			}
			foreach (BindingSource fireBindingSource3 in fireBindingSources)
			{
				_ = fireBindingSource3;
				foreach (BindingSource blockBindingSource3 in blockBindingSources)
				{
					PlayerActions.Fire.AddBinding(blockBindingSource3);
				}
			}
		}

		private void OnDestroy()
		{
			foreach (BindingSource blockBindingSource in blockBindingSources)
			{
				if (!PlayerActions.Block.HasBinding(blockBindingSource))
				{
					PlayerActions.Block.AddBinding(blockBindingSource);
				}
			}
			foreach (BindingSource fireBindingSource in fireBindingSources)
			{
				if (!PlayerActions.Fire.HasBinding(fireBindingSource))
				{
					PlayerActions.Fire.AddBinding(fireBindingSource);
				}
			}
		}
	}
}
namespace AALUND13Cards.Curses.Handlers
{
	public class FlashlightMaskHandler : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <FadeCoroutine>d__17 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FlashlightMaskHandler <>4__this;

			public float from;

			public float to;

			public float duration;

			private float <elapsed>5__2;

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

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

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

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

			private bool MoveNext()
			{
				int num = <>1__state;
				FlashlightMaskHandler flashlightMaskHandler = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<elapsed>5__2 = 0f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<elapsed>5__2 < duration)
				{
					<elapsed>5__2 += Time.deltaTime;
					flashlightMaskHandler.globalFade = Mathf.Lerp(from, to, Mathf.Clamp01(<elapsed>5__2 / duration));
					flashlightMaskHandler.mat.SetFloat("_GlobalFade", flashlightMaskHandler.globalFade);
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				flashlightMaskHandler.globalFade = to;
				flashlightMaskHandler.mat.SetFloat("_GlobalFade", flashlightMaskHandler.globalFade);
				flashlightMaskHandler.fadeCoroutine = null;
				return false;
			}

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

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

		public Material mat;

		public float RadiusFadeInMultiplier = 0.2f;

		public float RadiusFadeOutMultiplier = 1f;

		public float FadeDuration = 2f;

		private Dictionary<Player, float> currentRadii = new Dictionary<Player, float>();

		private Coroutine fadeCoroutine;

		private float globalFade;

		private bool isBattleActive;

		private bool oldIsBattleActive;

		public static FlashlightMaskHandler Instance { get; private set; }

		private void Awake()
		{
			Instance = this;
			globalFade = 0f;
			mat.SetFloat("_GlobalFade", globalFade);
		}

		private void OnDestroy()
		{
			if (fadeCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(fadeCoroutine);
			}
			Instance = null;
		}

		private void Update()
		{
			//IL_0103: 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)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			List<Player> list = PlayerManager.instance.players.Where((Player p) => p.data.view.IsMine && !p.data.dead).ToList();
			int num = Mathf.Clamp(list.Count, 0, 32);
			isBattleActive = GameManager.instance.battleOngoing && list.Any((Player p) => CharacterDataExtensions.GetCustomStatsRegistry(p.data).GetOrCreate<CursesStats>().IsBind) && num > 0;
			if (isBattleActive != oldIsBattleActive)
			{
				oldIsBattleActive = isBattleActive;
				if (isBattleActive)
				{
					OnBattleStart();
				}
				else
				{
					OnBattleEnd();
				}
			}
			Vector4[] array = (Vector4[])(object)new Vector4[32];
			float[] array2 = new float[32];
			Camera main = Camera.main;
			for (int i = 0; i < num; i++)
			{
				Player val = list[i];
				if (!((Object)(object)val == (Object)null) && Object.op_Implicit((Object)(object)((Component)val).transform))
				{
					Vector3 val2 = main.WorldToViewportPoint(((Component)val).transform.position);
					array[i] = new Vector4(val2.x, val2.y, 0f, 0f);
					float num2 = CalculateRadius(val);
					if (!currentRadii.ContainsKey(val))
					{
						currentRadii[val] = num2;
					}
					float num3 = currentRadii[val];
					num3 = Mathf.MoveTowards(num3, num2, Time.deltaTime);
					currentRadii[val] = num3;
					array2[i] = num3;
				}
			}
			for (int j = num; j < 32; j++)
			{
				array[j] = Vector4.zero;
				array2[j] = 0f;
			}
			mat.SetVectorArray("_LightPosArray", array);
			mat.SetFloatArray("_RadiusArray", array2);
			mat.SetInt("_LightCount", num);
			foreach (Player item in currentRadii.Keys.Except(list).ToList())
			{
				currentRadii.Remove(item);
			}
		}

		private float CalculateRadius(Player player)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player == (Object)null || !Object.op_Implicit((Object)(object)((Component)player).transform))
			{
				return 0f;
			}
			float orthographicSize = Camera.main.orthographicSize;
			float num = Mathf.Max(((Component)player).transform.localScale.x, 2f);
			float num2 = 1f / Mathf.Max(orthographicSize, 0.01f);
			float num3 = (isBattleActive ? RadiusFadeInMultiplier : RadiusFadeOutMultiplier);
			return Mathf.Max(num * num2 * num3, 0.01f);
		}

		[IteratorStateMachine(typeof(<FadeCoroutine>d__17))]
		private IEnumerator FadeCoroutine(float from, float to, float duration)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <FadeCoroutine>d__17(0)
			{
				<>4__this = this,
				from = from,
				to = to,
				duration = duration
			};
		}

		public void OnBattleStart()
		{
			isBattleActive = true;
			if (fadeCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(fadeCoroutine);
			}
			fadeCoroutine = ((MonoBehaviour)this).StartCoroutine(FadeCoroutine(globalFade, 1f, FadeDuration));
		}

		public void OnBattleEnd()
		{
			isBattleActive = false;
			if (fadeCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(fadeCoroutine);
			}
			fadeCoroutine = ((MonoBehaviour)this).StartCoroutine(FadeCoroutine(globalFade, 0f, FadeDuration));
		}
	}
}
namespace AALUND13Cards.Curses.Cards
{
	public class CursesStats : ICustomStats
	{
		public bool IsBind;

		public bool DisableDecayTime;

		public void ResetStats()
		{
			DisableDecayTime = false;
			IsBind = false;
		}
	}
}
namespace AALUND13Cards.Curses.Cards.StatModifers
{
	public class CursesStatsModifers : CustomStatModifers
	{
		[Header("Curses Stats")]
		public bool IsBind;

		public bool DisableDecayTime;

		public override void Apply(Player player)
		{
			CursesStats orCreate = CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<CursesStats>();
			if (IsBind)
			{
				orCreate.IsBind = true;
			}
			if (DisableDecayTime)
			{
				orCreate.DisableDecayTime = true;
			}
		}
	}
}

plugins/AALUND13_Extra_Picks_Cards.dll

Decompiled 3 days 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 AALUND13Cards.Core;
using AALUND13Cards.Core.Cards;
using AALUND13Cards.Core.Cards.Effects;
using AALUND13Cards.Core.Extensions;
using AALUND13Cards.Core.Utils;
using AALUND13Cards.ExtraCards.Cards;
using AALUND13Cards.ExtraCards.Handlers;
using AALUND13Cards.ExtraCards.Handlers.ExtraPickHandlers;
using BepInEx;
using CorruptedCardsManager;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.GameModes;
using ModdingUtils.Utils;
using ModsPlus;
using Photon.Pun;
using RandomCardsGenerators;
using RandomCardsGenerators.Cards;
using RandomCardsGenerators.StatsGroup;
using TabInfo.Utils;
using UnboundLib;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[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]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AALUND13Cards.Core.VisualEffect
{
	public class CorruptedCardVisualEffect : MonoBehaviour
	{
		private const float ROTATE_CARD_CHANCE = 5f;

		private const float ROTATE_CARD_ANGLE_LIMIT = 180f;

		private float oldRotationZ;

		private bool init;

		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = ((Component)this).transform.rotation;
			oldRotationZ = ((Quaternion)(ref rotation)).eulerAngles.z;
			init = true;
		}

		private void Update()
		{
			//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_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation;
			if (!init)
			{
				rotation = ((Component)this).transform.rotation;
				oldRotationZ = ((Quaternion)(ref rotation)).eulerAngles.z;
				init = true;
			}
			if (Random.Range(0f, 100f) < 5f)
			{
				((Component)this).transform.Rotate(0f, 0f, Random.Range(-180f, 180f));
				return;
			}
			rotation = ((Component)this).transform.rotation;
			Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
			eulerAngles.z = oldRotationZ;
			((Component)this).transform.rotation = Quaternion.Euler(eulerAngles);
		}

		private void OnDisable()
		{
			//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_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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)
			if (init)
			{
				Quaternion rotation = ((Component)this).transform.rotation;
				Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
				eulerAngles.z = oldRotationZ;
				((Component)this).transform.rotation = Quaternion.Euler(eulerAngles);
			}
		}

		private void OnDestroy()
		{
			//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_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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)
			if (init)
			{
				Quaternion rotation = ((Component)this).transform.rotation;
				Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
				eulerAngles.z = oldRotationZ;
				((Component)this).transform.rotation = Quaternion.Euler(eulerAngles);
			}
		}
	}
}
namespace AALUND13Cards.Core.Patches
{
	[HarmonyPatch(typeof(CardChoice))]
	public class CardChoicePatch
	{
		[HarmonyPatch("IDoEndPick")]
		private static void Postfix(GameObject pickedCard, int theInt, int pickId)
		{
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			Player playerWithID = ExtensionMethods.GetPlayerWithID(PlayerManager.instance, pickId);
			if ((Object)(object)playerWithID == (Object)null)
			{
				return;
			}
			if ((Object)(object)ExtraCardPickHandler.currentPlayer != (Object)null && ExtraCardPickHandler.extraPicks.ContainsKey(playerWithID) && ExtraCardPickHandler.extraPicks[playerWithID].Count > 0)
			{
				ExtraCardPickHandler.activePickHandler.OnExtraPick(playerWithID, pickedCard.GetComponent<CardInfo>());
			}
			ExtraCardsStats orCreate = CharacterDataExtensions.GetCustomStatsRegistry(playerWithID.data).GetOrCreate<ExtraCardsStats>();
			if (orCreate.DuplicatesAsCorrupted == 0 || (!((Object)(object)pickedCard.GetComponent<RandomCard>() == (Object)null) && pickedCard.GetComponent<RandomCard>().StatGenName.StartsWith("CCM_CorruptedCardsGenerator")) || (!PhotonNetwork.IsMasterClient && !PhotonNetwork.OfflineMode))
			{
				return;
			}
			Rarity rarity = pickedCard.GetComponent<CardInfo>().rarity;
			if (Enum.IsDefined(typeof(CorruptedCardRarity), ((object)(Rarity)(ref rarity)).ToString()))
			{
				CorruptedCardRarity val = (CorruptedCardRarity)Enum.Parse(typeof(CorruptedCardRarity), ((object)(Rarity)(ref rarity)).ToString());
				for (int i = 0; i < orCreate.DuplicatesAsCorrupted; i++)
				{
					CorruptedCardsManager.CorruptedCardsGenerators.CreateRandomCard(val, playerWithID);
				}
			}
		}
	}
}
namespace AALUND13Cards.ExtraCards
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("AALUND13.Cards.Extra_Cards", "AALUND13 Extra Picks Cards", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	internal class AAC_ExtraCards : BaseUnityPlugin
	{
		[CompilerGenerated]
		private sealed class <OnPickStart>d__6 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public IGameModeHandler gameModeHandler;

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

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

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

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

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				foreach (Player player in PlayerManager.instance.players)
				{
					if (PhotonNetwork.IsMasterClient || PhotonNetwork.OfflineMode)
					{
						bool flag = gameModeHandler.GetRoundWinners().Contains(player.teamID);
						if (CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<ExtraCardsStats>().ExtraCardPicksPerPickPhase > 0 && !flag)
						{
							ExtraCardPickHandler.AddExtraPick<ExtraPickHandler>(player, CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<ExtraCardsStats>().ExtraCardPicksPerPickPhase);
						}
					}
				}
				return false;
			}

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

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

		internal const string ModId = "AALUND13.Cards.Extra_Cards";

		internal const string ModName = "AALUND13 Extra Picks Cards";

		internal const string Version = "1.0.0";

		private static AssetBundle assets;

		private void Awake()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			assets = AssetUtils.LoadAssetBundleFromResources("aac_extra_cards_assets", typeof(AAC_ExtraCards).Assembly);
			if ((Object)(object)assets != (Object)null)
			{
				new Harmony("AALUND13.Cards.Extra_Cards").PatchAll();
				CardsGenerators.RegisterGenerators();
			}
		}

		private void Start()
		{
			if ((Object)(object)assets == (Object)null)
			{
				Unbound.BuildModal("AALUND13 Cards Error", "The mod \"AALUND13 Extra Picks Cards\" assets failled to load, All the cards will be disable in this mod");
				throw new NullReferenceException("Failled to load \"AALUND13 Extra Picks Cards\" assets");
			}
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => ExtraCardPickHandler.HandleExtraPicks(ExtraPickPhaseTrigger.TriggerInPlayerPickEnd)));
			GameModeManager.AddHook("PickEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => ExtraCardPickHandler.HandleExtraPicks(ExtraPickPhaseTrigger.TriggerInPickEnd)));
			GameModeManager.AddHook("PickStart", (Func<IGameModeHandler, IEnumerator>)OnPickStart);
			if (AAC_Core.Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "com.willuwontu.rounds.tabinfo"))
			{
				TabinfoInterface.Setup();
			}
			assets.LoadAsset<GameObject>("ExtraPicksModCards").GetComponent<CardResgester>().RegisterCards();
		}

		[IteratorStateMachine(typeof(<OnPickStart>d__6))]
		private IEnumerator OnPickStart(IGameModeHandler gameModeHandler)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OnPickStart>d__6(0)
			{
				gameModeHandler = gameModeHandler
			};
		}
	}
	internal class TabinfoInterface
	{
		public static void Setup()
		{
			StatCategory orCreateCategory = TabinfoInterface.GetOrCreateCategory("AA Stats", 6);
			TabInfoManager.RegisterStat(orCreateCategory, "Extra Card Picks", (Func<Player, bool>)((Player p) => GetExtraCaedStatsFromPlayer(p).ExtraCardPicksPerPickPhase != 0), (Func<Player, string>)((Player p) => $"{GetExtraCaedStatsFromPlayer(p).ExtraCardPicksPerPickPhase}"));
			TabInfoManager.RegisterStat(orCreateCategory, "Duplicates As Corrupted", (Func<Player, bool>)((Player p) => GetExtraCaedStatsFromPlayer(p).DuplicatesAsCorrupted != 0), (Func<Player, string>)((Player p) => $"{GetExtraCaedStatsFromPlayer(p).DuplicatesAsCorrupted}"));
		}

		private static ExtraCardsStats GetExtraCaedStatsFromPlayer(Player player)
		{
			return CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<ExtraCardsStats>();
		}
	}
}
namespace AALUND13Cards.ExtraCards.Patches
{
	[HarmonyPatch(typeof(Cards), "PlayerIsAllowedCard")]
	public class AllowedCardPatch
	{
		private static void Postfix(Player player, CardInfo card, ref bool __result)
		{
			if (!((Object)(object)player == (Object)null) && !((Object)(object)card == (Object)null) && (Object)(object)ExtraCardPickHandler.currentPlayer != (Object)null && ExtraCardPickHandler.extraPicks.ContainsKey(player) && ExtraCardPickHandler.extraPicks[player].Count > 0)
			{
				bool flag = ExtraCardPickHandler.activePickHandler.OnExtraPickStart(player, card);
				__result &= flag;
			}
		}
	}
	[HarmonyPatch(typeof(CharacterStatModifiers))]
	public class CharacterStatModifiersPatch
	{
		[HarmonyPatch("ResetStats")]
		[HarmonyPrefix]
		public static void ResetStats(CharacterStatModifiers __instance)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue();
			CharacterDataExtensions.GetAdditionalData(val).Reset();
			if (ExtraCardPickHandler.extraPicks.ContainsKey(val.player))
			{
				ExtraCardPickHandler.extraPicks[val.player].Clear();
			}
		}
	}
}
namespace AALUND13Cards.ExtraCards.MonoBehaviours.CardsEffects
{
	public class CardFactoryMono : MonoBehaviour, IPickEndHookHandler
	{
		public int RandomCardsAtStart = 1;

		public float DefectiveCardChance = 0.7f;

		private Player Player;

		private Gun Gun;

		private GunAmmo GunAmmo;

		private CharacterData Data;

		private HealthHandler Health;

		private Gravity Gravity;

		private Block Block;

		private CharacterStatModifiers CharacterStats;

		public void Start()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			Player = ((Component)this).GetComponentInParent<Player>();
			Gun = Player.data.weaponHandler.gun;
			GunAmmo = (GunAmmo)ExtensionMethods.GetFieldValue((object)Gun, "gunAmmo");
			Data = Player.data;
			Health = Player.data.healthHandler;
			Gravity = ((Component)Player).GetComponent<Gravity>();
			Block = Player.data.block;
			CharacterStats = Player.data.stats;
			InterfaceGameModeHooksManager.instance.RegisterHooks((object)this);
		}

		public void OnDestroy()
		{
			InterfaceGameModeHooksManager.instance.RemoveHooks((object)this);
		}

		public void OnPickEnd()
		{
			if (!PhotonNetwork.IsMasterClient)
			{
				return;
			}
			for (int i = 0; i < RandomCardsAtStart; i++)
			{
				if (Random.Range(0f, 1f) < DefectiveCardChance)
				{
					CardInfo val = Cards.instance.NORARITY_GetRandomCardWithCondition(Player, Gun, GunAmmo, Data, Health, Gravity, Block, CharacterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)condition, 1000);
					Cards.instance.AddCardToPlayer(Player, val, false, "", 0f, 0f, true);
				}
				else
				{
					CardsGenerators.Generators.CreateRandomCard(AACardsGeneratorType.CardFactoryGenerator, Player);
				}
			}
		}

		private bool condition(CardInfo card, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			return !card.categories.Intersect(AAC_Core.NoLotteryCategories).Any();
		}
	}
}
namespace AALUND13Cards.ExtraCards.Handlers
{
	public enum ExtraPickPhaseTrigger
	{
		TriggerInPlayerPickEnd,
		TriggerInPickEnd
	}
	public class ExtraPickHandler
	{
		public virtual bool OnExtraPickStart(Player player, CardInfo card)
		{
			return true;
		}

		public virtual void OnExtraPick(Player player, CardInfo card)
		{
		}
	}
	public static class ExtraCardPickHandler
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass10_0
		{
			public Player player;

			internal bool <HandleExtraPickForPlayer>b__0(int i)
			{
				return PlayerManager.instance.players[i].playerID == player.playerID;
			}
		}

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

			private object <>2__current;

			public Player player;

			public ExtraPickPhaseTrigger pickPhaseTrigger;

			private <>c__DisplayClass10_0 <>8__1;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0114: Unknown result type (might be due to invalid IL or missing references)
				//IL_011e: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>8__1 = new <>c__DisplayClass10_0();
					<>8__1.player = player;
					currentPlayer = <>8__1.player;
					activePickHandler = extraPicks[<>8__1.player][pickPhaseTrigger][0];
					<>2__current = GameModeManager.TriggerHook("PlayerPickStart");
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					CardChoiceVisuals.instance.Show((from i in Enumerable.Range(0, PlayerManager.instance.players.Count)
						where PlayerManager.instance.players[i].playerID == <>8__1.player.playerID
						select i).First(), true);
					<>2__current = CardChoice.instance.DoPick(1, <>8__1.player.playerID, (PickerType)1);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<>2__current = (object)new WaitForSecondsRealtime(0.1f);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					if (extraPicks.ContainsKey(<>8__1.player) && extraPicks[<>8__1.player].ContainsKey(pickPhaseTrigger) && extraPicks[<>8__1.player][pickPhaseTrigger].Count > 0)
					{
						extraPicks[<>8__1.player][pickPhaseTrigger].RemoveAt(0);
					}
					<>2__current = GameModeManager.TriggerHook("PlayerPickEnd");
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -1;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public ExtraPickPhaseTrigger pickPhaseTrigger;

			private Player[] <>7__wrap1;

			private int <>7__wrap2;

			private Player <player>5__4;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>7__wrap1 = null;
				<player>5__4 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>7__wrap1 = PlayerManager.instance.players.ToArray();
					<>7__wrap2 = 0;
					goto IL_0173;
				case 1:
					<>1__state = -1;
					goto IL_00e3;
				case 2:
					{
						<>1__state = -1;
						goto IL_015e;
					}
					IL_0173:
					if (<>7__wrap2 < <>7__wrap1.Length)
					{
						<player>5__4 = <>7__wrap1[<>7__wrap2];
						if (extraPicks.ContainsKey(<player>5__4) && extraPicks[<player>5__4].ContainsKey(pickPhaseTrigger) && extraPicks[<player>5__4][pickPhaseTrigger].Count > 0)
						{
							if (pickPhaseTrigger == ExtraPickPhaseTrigger.TriggerInPickEnd)
							{
								goto IL_00e3;
							}
							<>2__current = HandleExtraPickForPlayer(<player>5__4, pickPhaseTrigger);
							<>1__state = 2;
							return true;
						}
						goto IL_015e;
					}
					<>7__wrap1 = null;
					currentPlayer = null;
					activePickHandler = null;
					return false;
					IL_015e:
					<player>5__4 = null;
					<>7__wrap2++;
					goto IL_0173;
					IL_00e3:
					if (extraPicks.ContainsKey(<player>5__4) && extraPicks[<player>5__4].ContainsKey(pickPhaseTrigger) && extraPicks[<player>5__4][pickPhaseTrigger].Count > 0)
					{
						<>2__current = HandleExtraPickForPlayer(<player>5__4, pickPhaseTrigger);
						<>1__state = 1;
						return true;
					}
					goto IL_015e;
				}
			}

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

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

		internal static Dictionary<Player, Dictionary<ExtraPickPhaseTrigger, List<ExtraPickHandler>>> extraPicks = new Dictionary<Player, Dictionary<ExtraPickPhaseTrigger, List<ExtraPickHandler>>>();

		public static ExtraPickHandler activePickHandler;

		public static Player currentPlayer;

		public static void AddExtraPick(ExtraPickHandler extraPickHandler, Player player, int picks, ExtraPickPhaseTrigger pickPhaseTrigger = ExtraPickPhaseTrigger.TriggerInPlayerPickEnd)
		{
			NetworkingManager.RPC(typeof(ExtraCardPickHandler), "RPCA_AddExtraPick", new object[4]
			{
				player.playerID,
				extraPickHandler.GetType().AssemblyQualifiedName,
				picks,
				pickPhaseTrigger
			});
		}

		public static void AddExtraPick<T>(Player player, int picks, ExtraPickPhaseTrigger pickPhaseTrigger = ExtraPickPhaseTrigger.TriggerInPlayerPickEnd) where T : ExtraPickHandler
		{
			NetworkingManager.RPC(typeof(ExtraCardPickHandler), "RPCA_AddExtraPick", new object[4]
			{
				player.playerID,
				typeof(T).AssemblyQualifiedName,
				picks,
				pickPhaseTrigger
			});
		}

		public static void RemoveExtraPick(ExtraPickHandler extraPickHandler, Player player, int picks)
		{
			NetworkingManager.RPC(typeof(ExtraCardPickHandler), "RPCA_RemoveExtraPick", new object[3]
			{
				player.playerID,
				extraPickHandler.GetType().AssemblyQualifiedName,
				picks
			});
		}

		public static void RemoveExtraPick<T>(Player player, int picks) where T : ExtraPickHandler
		{
			NetworkingManager.RPC(typeof(ExtraCardPickHandler), "RPCA_RemoveExtraPick", new object[3]
			{
				player.playerID,
				typeof(T).AssemblyQualifiedName,
				picks
			});
		}

		[UnboundRPC]
		private static void RPCA_AddExtraPick(int playerId, string handlerType, int picks, ExtraPickPhaseTrigger pickPhaseTrigger)
		{
			Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerId);
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			Type type = Type.GetType(handlerType);
			if (!(type == null))
			{
				ExtraPickHandler item = (ExtraPickHandler)Activator.CreateInstance(type);
				if (!extraPicks.ContainsKey(val))
				{
					extraPicks.Add(val, new Dictionary<ExtraPickPhaseTrigger, List<ExtraPickHandler>>());
				}
				if (!extraPicks[val].ContainsKey(pickPhaseTrigger))
				{
					extraPicks[val].Add(pickPhaseTrigger, new List<ExtraPickHandler>());
				}
				for (int i = 0; i < picks; i++)
				{
					extraPicks[val][pickPhaseTrigger].Add(item);
				}
			}
		}

		[UnboundRPC]
		public static void RPCA_RemoveExtraPick(int playerId, string handlerType, int picks)
		{
			Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerId);
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			Type type = Type.GetType(handlerType);
			if (type == null || !extraPicks.TryGetValue(val, out var value))
			{
				return;
			}
			int num = picks;
			List<ExtraPickPhaseTrigger> list = new List<ExtraPickPhaseTrigger>();
			foreach (ExtraPickPhaseTrigger item in value.Keys.ToList())
			{
				List<ExtraPickHandler> list2 = value[item];
				foreach (ExtraPickHandler item2 in list2.Where((ExtraPickHandler h) => h.GetType() == type).Take(num).ToList())
				{
					list2.Remove(item2);
					num--;
				}
				if (list2.Count == 0)
				{
					list.Add(item);
				}
				if (num <= 0)
				{
					break;
				}
			}
			foreach (ExtraPickPhaseTrigger item3 in list)
			{
				value.Remove(item3);
			}
			if (value.Count == 0)
			{
				extraPicks.Remove(val);
			}
		}

		[IteratorStateMachine(typeof(<HandleExtraPicks>d__9))]
		internal static IEnumerator HandleExtraPicks(ExtraPickPhaseTrigger pickPhaseTrigger)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <HandleExtraPicks>d__9(0)
			{
				pickPhaseTrigger = pickPhaseTrigger
			};
		}

		[IteratorStateMachine(typeof(<HandleExtraPickForPlayer>d__10))]
		private static IEnumerator HandleExtraPickForPlayer(Player player, ExtraPickPhaseTrigger pickPhaseTrigger)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <HandleExtraPickForPlayer>d__10(0)
			{
				player = player,
				pickPhaseTrigger = pickPhaseTrigger
			};
		}
	}
}
namespace AALUND13Cards.ExtraCards.Handlers.ExtraPickHandlers
{
	public class SteelPickHandler : ExtraPickHandler
	{
		public override bool OnExtraPickStart(Player player, CardInfo card)
		{
			if (card.categories.Intersect(AAC_Core.NoSteelCategories).Any())
			{
				return false;
			}
			List<CardInfo> list = new List<CardInfo>();
			foreach (Player enemyPlayer in PlayerStatus.GetEnemyPlayers(player))
			{
				if ((Object)(object)enemyPlayer != (Object)(object)player)
				{
					list.AddRange(enemyPlayer.data.currentCards);
				}
			}
			return list.Contains(card);
		}

		public override void OnExtraPick(Player player, CardInfo card)
		{
			if (!PhotonNetwork.OfflineMode && !PhotonNetwork.IsMasterClient)
			{
				return;
			}
			List<Player> list = new List<Player>();
			foreach (Player enemyPlayer in PlayerStatus.GetEnemyPlayers(player))
			{
				if (enemyPlayer.data.currentCards.Contains(CardChoice.instance.GetSourceCard(card)))
				{
					list.Add(enemyPlayer);
				}
			}
			if (list.Count != 0)
			{
				Player random = ExtensionMethods.GetRandom<Player>((IList)list);
				Cards.instance.RemoveCardFromPlayer(random, CardChoice.instance.GetSourceCard(card), (SelectionType)2);
			}
		}
	}
}
namespace AALUND13Cards.ExtraCards.Cards
{
	public enum AACardsGeneratorType
	{
		CardFactoryGenerator
	}
	internal class CardsGenerators
	{
		public static ModRandomCardsGenerators<AACardsGeneratorType> Generators;

		public static void RegisterGenerators()
		{
			Generators = new ModRandomCardsGenerators<AACardsGeneratorType>(new Dictionary<AACardsGeneratorType, RandomCardsGenerator> { 
			{
				AACardsGeneratorType.CardFactoryGenerator,
				CreateCardFactoryGenerator()
			} });
		}

		private static RandomCardsGenerator CreateCardFactoryGenerator()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Expected O, but got Unknown
			RandomCardOption val = default(RandomCardOption);
			((RandomCardOption)(ref val))..ctor("Defective Card", "AAC", "This card that come out the factory is defective, it has some negative stats.", "Dc", 1, 4, (Rarity)0, (CardThemeColorType)0);
			return new RandomCardsGenerator("DefectiveCardGenerators", val, new List<RandomStatGenerator>
			{
				(RandomStatGenerator)new DamageStatGenerator(-0.5f, 0f, 0.05f),
				(RandomStatGenerator)new ReloadTimeStatGenerator(0f, 0.5f, 0.05f),
				(RandomStatGenerator)new AttackSpeedStatGenerator(0f, 0.5f, 0.05f),
				(RandomStatGenerator)new MovementSpeedStatGenerator(-0.5f, 0f, 0.05f),
				(RandomStatGenerator)new HealthStatGenerator(-0.5f, 0f, 0.05f),
				(RandomStatGenerator)new BlockCooldownStatGenerator(0f, 0.5f, 0.025f),
				(RandomStatGenerator)new BulletSpeedStatGenerator(-0.5f, 0f, 0.05f)
			});
		}
	}
	public class ExtraCardsStats : ICustomStats
	{
		public int DuplicatesAsCorrupted;

		public int ExtraCardPicksPerPickPhase;

		public void ResetStats()
		{
			DuplicatesAsCorrupted = 0;
			ExtraCardPicksPerPickPhase = 0;
		}
	}
}
namespace AALUND13Cards.ExtraCards.Cards.StatModifers
{
	public enum ExtraPicksType
	{
		None,
		Normal,
		Steel
	}
	public class ExtraCardsStatsModifers : CustomStatModifers
	{
		[Header("Extra Picks")]
		public int ExtraPicks;

		public ExtraPicksType ExtraPicksType;

		public int ExtraPicksForEnemies;

		public ExtraPicksType ExtraPicksTypeForEnemies;

		public ExtraPickPhaseTrigger ExtraPickPhaseTrigger;

		[Header("Extra Cards")]
		public int ExtraCardPicks;

		public int DuplicatesAsCorrupted;

		public override void Apply(Player player)
		{
			CharacterData data = player.data;
			ExtraCardsStats additionalData = CharacterDataExtensions.GetCustomStatsRegistry(data).GetOrCreate<ExtraCardsStats>();
			additionalData.ExtraCardPicksPerPickPhase += ExtraCardPicks;
			ExtraPickHandler extraPickHandler = GetExtraPickHandler(ExtraPicksType);
			if (extraPickHandler != null && ExtraPicks > 0 && player.data.view.IsMine)
			{
				ExtraCardPickHandler.AddExtraPick(extraPickHandler, player, ExtraPicks, ExtraPickPhaseTrigger);
			}
			ExtraPickHandler extraPickHandler2 = GetExtraPickHandler(ExtraPicksTypeForEnemies);
			if (extraPickHandler != null && ExtraPicksForEnemies > 0 && player.data.view.IsMine)
			{
				foreach (Player enemyPlayer in PlayerStatus.GetEnemyPlayers(player))
				{
					ExtraCardPickHandler.AddExtraPick(extraPickHandler2, enemyPlayer, ExtraPicksForEnemies, ExtraPickPhaseTrigger);
				}
			}
			if (DuplicatesAsCorrupted > 0)
			{
				ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)AAC_Core.Instance, 1, (Action)delegate
				{
					additionalData.DuplicatesAsCorrupted += DuplicatesAsCorrupted;
				});
			}
		}

		public override void OnReassign(Player player)
		{
			CharacterDataExtensions.GetAdditionalData(player.data).CustomStatsRegistry.GetOrCreate<ExtraCardsStats>().ExtraCardPicksPerPickPhase += ExtraCardPicks;
		}

		public ExtraPickHandler GetExtraPickHandler(ExtraPicksType type)
		{
			return type switch
			{
				ExtraPicksType.Normal => new ExtraPickHandler(), 
				ExtraPicksType.Steel => new SteelPickHandler(), 
				_ => null, 
			};
		}
	}
}
namespace AALUND13Cards.ExtraCards.Cards.Effects
{
	public class PickCardFromListEffect : OnAddedEffect
	{
		public List<GameObject> randomCardsToChoseFrom = new List<GameObject>();

		public int cardCount = 1;

		public override void OnAdded(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (!PhotonNetwork.OfflineMode && !PhotonNetwork.IsMasterClient)
			{
				return;
			}
			for (int i = 0; i < cardCount; i++)
			{
				if (randomCardsToChoseFrom.Count == 0)
				{
					LoggerUtils.LogWarn("No cards to choose from. Please add cards to the list.");
					break;
				}
				CardInfo component = ExtensionMethods.GetRandom<GameObject>((IList)randomCardsToChoseFrom).GetComponent<CardInfo>();
				Cards.instance.AddCardToPlayer(player, component, true, "", 2f, 2f, true);
				CardBarUtils.instance.ShowAtEndOfPhase(player, component);
			}
		}
	}
}

plugins/AALUND13_Standard_Cards.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AALUND13Cards.Core;
using AALUND13Cards.Core.Cards;
using AALUND13Cards.Core.Extensions;
using AALUND13Cards.Core.Handlers;
using AALUND13Cards.Core.Utils;
using AALUND13Cards.Standard.Cards;
using BepInEx;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using HarmonyLib;
using JARL.Bases;
using JARL.Extensions;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.Utils;
using ModsPlus;
using Photon.Pun;
using RarityLib.Utils;
using Sonigon;
using SoundImplementation;
using TabInfo.Utils;
using UnboundLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[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]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AALUND13Cards.Core.Patches
{
	[HarmonyPatch(typeof(Cards), "PlayerIsAllowedCard")]
	internal class AllowedCardPatch
	{
		private static void Postfix(Player player, CardInfo card, ref bool __result)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)player == (Object)null) && !((Object)(object)card == (Object)null) && card.categories.Contains(CustomCardCategories.instance.CardCategory("Curse")) && CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<StandardStats>().MaxRarityForCurse != null)
			{
				Rarity rarityData = RarityUtils.GetRarityData(card.rarity);
				Rarity maxRarityForCurse = CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<StandardStats>().MaxRarityForCurse;
				if (rarityData.relativeRarity < maxRarityForCurse.relativeRarity)
				{
					__result = false;
				}
			}
		}
	}
}
namespace AALUND13Cards.Core.MonoBehaviours.ProjectilesEffects
{
	public class ConnectingBullets : MonoBehaviour
	{
		private static Dictionary<Player, GameObject> PlayerLastBullet = new Dictionary<Player, GameObject>();

		public float DamageInterval = 0.5f;

		public float DamageMultiplier = 0.75f;

		public float MaxDistance = 20f;

		public float SpawnTimeTrigger = 0.5f;

		public GameObject ConnectingBulletPrefab;

		private Dictionary<Player, float> lastDamageTime = new Dictionary<Player, float>();

		private GameObject connectingBulletInstance;

		private GameObject connectedBullet;

		private ProjectileHit ProjectileHit;

		private ChildRPC childRPC;

		private float spawnTime;

		private void Start()
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			ProjectileHit = ((Component)this).GetComponentInParent<ProjectileHit>();
			childRPC = ((Component)this).GetComponentInParent<ChildRPC>();
			if (PlayerLastBullet.ContainsKey(ProjectileHit.ownPlayer) && (Object)(object)PlayerLastBullet[ProjectileHit.ownPlayer] != (Object)null && Vector2.Distance(Vector2.op_Implicit(PlayerLastBullet[ProjectileHit.ownPlayer].transform.position), Vector2.op_Implicit(((Component)this).gameObject.transform.position)) < MaxDistance)
			{
				connectingBulletInstance = Object.Instantiate<GameObject>(ConnectingBulletPrefab, Vector2.op_Implicit(Vector2.zero), Quaternion.identity);
				LineEffect component = connectingBulletInstance.GetComponent<LineEffect>();
				connectedBullet = PlayerLastBullet[ProjectileHit.ownPlayer];
				component.fromPos = connectedBullet.transform;
				component.toPos = ((Component)this).gameObject.transform;
				LineRenderer component2 = connectingBulletInstance.GetComponent<LineRenderer>();
				component2.startColor = GetProjectileColor(connectedBullet.GetComponent<ProjectileHit>());
				component2.endColor = GetProjectileColor(ProjectileHit);
				component2.SetPositions((Vector3[])(object)new Vector3[2]
				{
					connectedBullet.transform.position,
					((Component)this).gameObject.transform.position
				});
			}
			PlayerLastBullet[ProjectileHit.ownPlayer] = ((Component)((Component)this).transform.parent).gameObject;
			spawnTime = Time.time;
		}

		private Color GetProjectileColor(ProjectileHit projectileHit)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0021: Unknown result type (might be due to invalid IL or missing references)
			if (projectileHit.projectileColor == Color.black)
			{
				return new Color(0.75f, 0.28530002f, 0.0882f);
			}
			return projectileHit.projectileColor * 0.75f;
		}

		private void Update()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: 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)
			if ((Object)(object)connectedBullet == (Object)null && (Object)(object)connectingBulletInstance != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			else if ((Object)(object)connectingBulletInstance != (Object)null && Vector2.Distance(Vector2.op_Implicit(connectedBullet.transform.position), Vector2.op_Implicit(((Component)this).gameObject.transform.position)) > MaxDistance)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private void FixedUpdate()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)connectingBulletInstance != (Object)null && (Object)(object)connectedBullet != (Object)null)
			{
				DamageBetweenPoints(Vector2.op_Implicit(connectedBullet.transform.position), Vector2.op_Implicit(((Component)this).gameObject.transform.position));
			}
		}

		private void OnDestroy()
		{
			if ((Object)(object)connectingBulletInstance != (Object)null)
			{
				Object.Destroy((Object)(object)connectingBulletInstance);
			}
		}

		private void DamageBetweenPoints(Vector2 pointA, Vector2 pointB)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			if (!ProjectileHit.ownPlayer.data.view.IsMine)
			{
				return;
			}
			Vector2 val = (pointA + pointB) / 2f;
			RaycastHit2D[] array = Physics2D.LinecastAll(pointA, pointB);
			for (int i = 0; i < array.Length; i++)
			{
				RaycastHit2D val2 = array[i];
				Player component = ((Component)((RaycastHit2D)(ref val2)).collider).GetComponent<Player>();
				if ((Object)(object)component != (Object)null && (!((Object)(object)component == (Object)(object)ProjectileHit.ownPlayer) || !(Time.time < spawnTime + SpawnTimeTrigger)))
				{
					if (!lastDamageTime.ContainsKey(component))
					{
						lastDamageTime[component] = 0f;
					}
					if (Time.time - lastDamageTime[component] >= DamageInterval)
					{
						lastDamageTime[component] = Time.time;
						Vector3 val3 = ((Component)component).transform.position - Vector2.op_Implicit(val);
						Vector2 val4 = Vector2.op_Implicit(((Vector3)(ref val3)).normalized);
						((Damagable)component.data.healthHandler).CallTakeDamage(val4 * GetChainDamage(component), Vector2.op_Implicit(((Component)component).transform.position), ProjectileHit.ownWeapon, ProjectileHit.ownPlayer, true);
					}
				}
			}
		}

		private float GetChainDamage(Player targetPlayer)
		{
			float damage = ProjectileHit.damage;
			float damage2 = connectedBullet.GetComponent<ProjectileHit>().damage;
			float percentageDamage = ProjectileHit.percentageDamage;
			float percentageDamage2 = connectedBullet.GetComponent<ProjectileHit>().percentageDamage;
			return ((damage + damage2) / 2f + targetPlayer.data.maxHealth * (percentageDamage + percentageDamage2) / 2f) * DamageMultiplier;
		}
	}
	public class RayHitExecution : RayHitEffect
	{
		[Range(0f, 1f)]
		public float executionPercentage = 0.3f;

		public override HasToReturn DoHitEffect(HitInfo hit)
		{
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)hit.transform))
			{
				CharacterData component = ((Component)hit.transform).GetComponent<CharacterData>();
				if (!((Object)(object)component == (Object)null) && !component.dead)
				{
					if (!((component.health + CharacterDataExtensions.GetAdditionalData(component).totalArmor) / component.maxHealth > executionPercentage))
					{
						if (component.stats.remainingRespawns > 0)
						{
							component.view.RPC("RPCA_Die_Phoenix", (RpcTarget)0, new object[1] { Vector2.down });
						}
						else
						{
							component.view.RPC("RPCA_Die", (RpcTarget)0, new object[1] { Vector2.down });
						}
						component.health = 0f;
						return (HasToReturn)1;
					}
					return (HasToReturn)1;
				}
				return (HasToReturn)1;
			}
			return (HasToReturn)1;
		}
	}
}
namespace AALUND13Cards.Core.MonoBehaviours.CardsEffects
{
	public class CurrentHPRegenMono : MonoBehaviour
	{
		[Tooltip("Percentage of current health to activate the regeneration. If the character's health is above this percentage, regeneration will not be applied.")]
		public float activatePercentage = 0.75f;

		public float CurrentHPRegenPercentage = 0.15f;

		private CharacterData data;

		private float oldRegen;

		private void Start()
		{
			data = ((Component)this).GetComponentInParent<CharacterData>();
		}

		public void Update()
		{
			if (oldRegen != 0f && data.health / data.maxHealth > activatePercentage)
			{
				HealthHandler healthHandler = data.healthHandler;
				healthHandler.regeneration -= oldRegen;
				oldRegen = 0f;
			}
			else if (data.health / data.maxHealth <= activatePercentage)
			{
				float num = data.health * CurrentHPRegenPercentage;
				HealthHandler healthHandler2 = data.healthHandler;
				healthHandler2.regeneration -= oldRegen;
				HealthHandler healthHandler3 = data.healthHandler;
				healthHandler3.regeneration += num;
				oldRegen = num;
			}
		}
	}
	public class RollBackTeleport : MonoBehaviour
	{
		[Header("Sounds")]
		public SoundEvent SoundTeleport;

		[Header("Teleport Settings")]
		public GameObject SaveTeleportPositionPrefab;

		[Header("Particle Systems")]
		public ParticleSystem[] parts;

		public ParticleSystem[] remainParts;

		private GameObject saveTeleportPosition;

		private CharacterData data;

		private Vector2 SavePosition;

		private bool DoTeleport;

		private void Start()
		{
			data = ((Component)this).GetComponentInParent<CharacterData>();
			SoundTeleport.variables.audioMixerGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
			Block componentInParent = ((Component)this).GetComponentInParent<Block>();
			componentInParent.SuperFirstBlockAction = (Action<BlockTriggerType>)Delegate.Combine(componentInParent.SuperFirstBlockAction, new Action<BlockTriggerType>(OnBlock));
			HealthHandler healthHandler = data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(ResetTeleport));
			if (data.view.IsMine)
			{
				saveTeleportPosition = Object.Instantiate<GameObject>(SaveTeleportPositionPrefab);
				saveTeleportPosition.SetActive(false);
			}
		}

		private void OnDestroy()
		{
			Block componentInParent = ((Component)this).GetComponentInParent<Block>();
			componentInParent.SuperFirstBlockAction = (Action<BlockTriggerType>)Delegate.Remove(componentInParent.SuperFirstBlockAction, new Action<BlockTriggerType>(OnBlock));
			HealthHandler healthHandler = data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(ResetTeleport));
			if ((Object)(object)saveTeleportPosition != (Object)null)
			{
				Object.Destroy((Object)(object)saveTeleportPosition);
			}
		}

		private void OnDisable()
		{
			ResetTeleport();
		}

		public void OnBlock(BlockTriggerType triggerType)
		{
			//IL_0000: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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)
			if ((int)triggerType != 0)
			{
				return;
			}
			if (DoTeleport)
			{
				Vector2 val = Vector2.op_Implicit(((Component)data).transform.position);
				((Component)this).GetComponentInParent<PlayerCollision>().IgnoreWallForFrames(2);
				((Component)data).transform.position = Vector2.op_Implicit(SavePosition);
				for (int i = 0; i < remainParts.Length; i++)
				{
					((Component)remainParts[i]).transform.position = Vector2.op_Implicit(val);
					remainParts[i].Play();
				}
				for (int j = 0; j < parts.Length; j++)
				{
					((Component)parts[j]).transform.position = Vector2.op_Implicit(SavePosition);
					parts[j].Play();
				}
				SoundManager.Instance.Play(SoundTeleport, ((Component)data).transform);
				ExtensionMethods.SetFieldValue((object)data.playerVel, "velocity", (object)Vector2.zero);
				data.sinceGrounded = 0f;
				ResetTeleport();
			}
			else
			{
				if ((Object)(object)saveTeleportPosition != (Object)null)
				{
					saveTeleportPosition.transform.position = ((Component)data).transform.position;
					saveTeleportPosition.SetActive(true);
				}
				SavePosition = Vector2.op_Implicit(((Component)data).transform.position);
				DoTeleport = true;
			}
		}

		public void ResetTeleport()
		{
			//IL_0022: 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)
			if ((Object)(object)saveTeleportPosition != (Object)null)
			{
				saveTeleportPosition.SetActive(false);
			}
			DoTeleport = false;
			SavePosition = Vector2.zero;
		}
	}
	public class StoreDamageEffect : MonoBehaviour, IOnDoDamageEvent
	{
		public float DamageToStorePercentage = 0.5f;

		public float MaxStoredDamageMultiplier = 5f;

		[Tooltip("Cooldown time in seconds before damage can be stored again after releasing stored damage.")]
		public float CoolddownTime = 5f;

		private float maxStoredDamage = 100f;

		private float storedDamage;

		private float cooldownTimer;

		private bool damageReductionApplied;

		private Player player;

		private DamageSpawnObjects damageSpawnObjects;

		private CustomHealthBar storedDamageBar;

		public void ReleaseStoredDamage()
		{
			//IL_0013: 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 (storedDamage > 0f)
			{
				damageSpawnObjects.SpawnDamage(Vector2.up * storedDamage);
				ResetStoredDamage();
				cooldownTimer = CoolddownTime;
			}
		}

		public void OnDamage(DamageInfo damage)
		{
			if (!(cooldownTimer > 0f))
			{
				float num = ((Vector2)(ref damage.Damage)).magnitude / (1f - DamageToStorePercentage);
				storedDamage = Mathf.Min(maxStoredDamage, storedDamage + num * DamageToStorePercentage);
				if (storedDamage == maxStoredDamage && damageReductionApplied)
				{
					CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<StandardStats>().DamageReduction -= DamageToStorePercentage;
					damageReductionApplied = false;
				}
				storedDamageBar.CurrentHealth = storedDamage;
			}
		}

		public void ResetStoredDamage()
		{
			storedDamage = 0f;
			storedDamageBar.CurrentHealth = storedDamage;
			if (!damageReductionApplied)
			{
				CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<StandardStats>().DamageReduction += DamageToStorePercentage;
				damageReductionApplied = true;
			}
		}

		private void Start()
		{
			player = ((Component)this).GetComponentInParent<Player>();
			damageSpawnObjects = ((Component)this).GetComponent<DamageSpawnObjects>();
			storedDamageBar = CreateStoredDamageBar();
			DamageEventHandler.Instance.RegisterDamageEvent((object)this, player);
			HealthHandler healthHandler = player.data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(OnRevive));
			maxStoredDamage = player.data.maxHealth * MaxStoredDamageMultiplier;
			storedDamageBar.SetValues(0f, maxStoredDamage);
			ResetStoredDamage();
		}

		private void OnDestroy()
		{
			DamageEventHandler.Instance.UnregisterDamageEvent((object)this, player);
			HealthHandler healthHandler = player.data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(OnRevive));
			Object.Destroy((Object)(object)((Component)storedDamageBar).gameObject);
		}

		private void Update()
		{
			maxStoredDamage = player.data.maxHealth * MaxStoredDamageMultiplier;
			storedDamageBar.MaxHealth = maxStoredDamage;
			if (cooldownTimer > 0f)
			{
				cooldownTimer = Mathf.Max(0f, cooldownTimer - TimeHandler.deltaTime);
				if (damageReductionApplied)
				{
					CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<StandardStats>().DamageReduction -= DamageToStorePercentage;
					damageReductionApplied = false;
				}
				else if (cooldownTimer <= 0f && !damageReductionApplied)
				{
					CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<StandardStats>().DamageReduction += DamageToStorePercentage;
					damageReductionApplied = true;
				}
			}
			if (storedDamage > maxStoredDamage)
			{
				storedDamage = maxStoredDamage;
				storedDamageBar.CurrentHealth = storedDamage;
			}
		}

		private CustomHealthBar CreateStoredDamageBar()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Damage Storage Bar");
			CustomHealthBar obj = val.AddComponent<CustomHealthBar>();
			obj.SetColor(new Color(1f, 0.64705884f, 0f, 1f) * 0.8f);
			ExtensionMethods.AddStatusIndicator(player, val, 0f, true);
			Object.Destroy((Object)(object)((Component)val.transform.Find("Healthbar(Clone)/Canvas/Image/White")).gameObject);
			return obj;
		}

		private void OnRevive()
		{
			ResetStoredDamage();
			cooldownTimer = 0f;
		}
	}
}
namespace AALUND13Cards.Standard
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("AALUND13.Cards.Standard", "AALUND13 Standard Cards", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	internal class AAC_Standard : BaseUnityPlugin
	{
		internal const string ModId = "AALUND13.Cards.Standard";

		internal const string ModName = "AALUND13 Standard Cards";

		internal const string Version = "1.0.0";

		private static AssetBundle assets;

		private void Awake()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			assets = AssetUtils.LoadAssetBundleFromResources("aac_standard_assets", typeof(AAC_Standard).Assembly);
			if ((Object)(object)assets != (Object)null)
			{
				new Harmony("AALUND13.Cards.Standard").PatchAll();
			}
		}

		private void Start()
		{
			if ((Object)(object)assets == (Object)null)
			{
				Unbound.BuildModal("AALUND13 Cards Error", "The mod \"AALUND13 Standard Cards\" assets failled to load, All the cards will be disable in this mod");
				throw new NullReferenceException("Failled to load \"AALUND13 Standard Cards\" assets");
			}
			if (AAC_Core.Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "com.willuwontu.rounds.tabinfo"))
			{
				TabinfoInterface.Setup();
			}
			assets.LoadAsset<GameObject>("StandardModCards").GetComponent<CardResgester>().RegisterCards();
		}
	}
	internal class TabinfoInterface
	{
		public static void Setup()
		{
			StatCategory orCreateCategory = TabinfoInterface.GetOrCreateCategory("AA Stats", 6);
			TabInfoManager.RegisterStat(orCreateCategory, "Delay Damage", (Func<Player, bool>)((Player p) => GetStandardStatsFromPlayer(p).secondToDealDamage != 0f), (Func<Player, string>)((Player p) => $"{GetStandardStatsFromPlayer(p).secondToDealDamage} seconds"));
			TabInfoManager.RegisterStat(orCreateCategory, "Blocks When Recharge", (Func<Player, bool>)((Player p) => GetStandardStatsFromPlayer(p).BlocksWhenRecharge != 0), (Func<Player, string>)((Player p) => $"{GetStandardStatsFromPlayer(p).BlocksWhenRecharge}"));
			TabInfoManager.RegisterStat(orCreateCategory, "Stun Block Time", (Func<Player, bool>)((Player p) => GetStandardStatsFromPlayer(p).StunBlockTime != 0f), (Func<Player, string>)((Player p) => $"{GetStandardStatsFromPlayer(p).StunBlockTime:0}s"));
			TabInfoManager.RegisterStat(orCreateCategory, "Max Rarity For Curse", (Func<Player, bool>)((Player p) => GetStandardStatsFromPlayer(p).MaxRarityForCurse != null), (Func<Player, string>)((Player p) => GetStandardStatsFromPlayer(p).MaxRarityForCurse.name));
			TabInfoManager.RegisterStat(orCreateCategory, "Damage Reduction", (Func<Player, bool>)((Player p) => GetStandardStatsFromPlayer(p).DamageReduction != 0f), (Func<Player, string>)((Player p) => $"{GetStandardStatsFromPlayer(p).DamageReduction * 100f:0}%"));
		}

		private static StandardStats GetStandardStatsFromPlayer(Player player)
		{
			return CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<StandardStats>();
		}
	}
}
namespace AALUND13Cards.Standard.Patches
{
	[HarmonyPatch(typeof(Block))]
	internal class BlockPatch
	{
		public static Dictionary<Block, bool> BlockRechargeAlreadyTriggered = new Dictionary<Block, bool>();

		[HarmonyPatch("IDoBlock")]
		[HarmonyPrefix]
		public static void IDoBlockPrefix(Block __instance, bool firstBlock, bool dontSetCD, BlockTriggerType triggerType)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (!(!firstBlock || dontSetCD) && (int)triggerType == 0)
			{
				BlockRechargeAlreadyTriggered[__instance] = false;
			}
		}

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void StartPostfix(Block __instance)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			CharacterData data = (CharacterData)ExtensionMethods.GetFieldValue((object)__instance, "data");
			__instance.BlockRechargeAction = delegate
			{
				if (!(BlockRechargeAlreadyTriggered.TryGetValue(__instance, out var value) && value))
				{
					for (int i = 0; i < CharacterDataExtensions.GetCustomStatsRegistry(data).GetOrCreate<StandardStats>().BlocksWhenRecharge; i++)
					{
						float num = (float)ExtensionMethods.GetFieldValue((object)__instance, "timeBetweenBlocks");
						float num2 = (float)i * num;
						((MonoBehaviour)__instance).StartCoroutine("DelayBlock", (object)num2);
					}
					BlockRechargeAlreadyTriggered[__instance] = true;
				}
			};
		}

		[HarmonyPatch("blocked")]
		[HarmonyPrefix]
		public static void BlockedPrefix(Block __instance, GameObject projectile, Vector3 forward, Vector3 hitPos)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			ProjectileHit component = projectile.GetComponent<ProjectileHit>();
			_ = (HealthHandler)ExtensionMethods.GetFieldValue((object)__instance, "health");
			CharacterData data = component.ownPlayer.data;
			CharacterData val = (CharacterData)ExtensionMethods.GetFieldValue((object)__instance, "data");
			bool flag = false;
			if ((Object)(object)data != (Object)null && CharacterDataExtensions.GetCustomStatsRegistry(data).GetOrCreate<StandardStats>().StunBlockTime > 0f)
			{
				((MonoBehaviour)val.block).StopAllCoroutines();
				val.block.sinceBlock = float.PositiveInfinity;
				val.stunHandler.AddStun(val.stunTime + CharacterDataExtensions.GetCustomStatsRegistry(data).GetOrCreate<StandardStats>().StunBlockTime);
				flag = true;
			}
			if (flag)
			{
				Object.Destroy((Object)(object)projectile);
			}
		}
	}
	[HarmonyPatch(typeof(HealthHandler))]
	internal class HealthHandlerPatch
	{
		[HarmonyPatch("DoDamage")]
		[HarmonyPrefix]
		public static void DoDamage(HealthHandler __instance, ref Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, bool lethal, bool ignoreBlock)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue();
			StandardStats characterAdditionalData = CharacterDataExtensions.GetCustomStatsRegistry(val).GetOrCreate<StandardStats>();
			if (characterAdditionalData.DamageReduction > 0f)
			{
				damage = new Vector2(damage.x * (1f - characterAdditionalData.DamageReduction), damage.y * (1f - characterAdditionalData.DamageReduction));
			}
			if (characterAdditionalData.secondToDealDamage > 0f && !characterAdditionalData.dealDamage)
			{
				Vector2 val2 = default(Vector2);
				((Vector2)(ref val2))..ctor(damage.x, damage.y);
				ExtensionMethods.GetOrAddComponent<DelayDamageHandler>(((Component)__instance).gameObject, false).DelayDamage(new DelayDamageInfo(val2, position, blinkColor, damagingWeapon, damagingPlayer, healthRemoval, lethal, ignoreBlock), characterAdditionalData.secondToDealDamage, (Action)delegate
				{
					characterAdditionalData.dealDamage = true;
				}, (Action)null);
				damage = Vector2.zero;
			}
			else if (characterAdditionalData.dealDamage)
			{
				characterAdditionalData.dealDamage = false;
			}
		}
	}
	[HarmonyPatch(typeof(ResetBlock), "Go")]
	internal class ResetBlockPatch
	{
		public static void Postfix(Block __instance)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			CharacterData val = (CharacterData)ExtensionMethods.GetFieldValue((object)__instance, "data");
			if (!(BlockPatch.BlockRechargeAlreadyTriggered.TryGetValue(__instance, out var value) && value))
			{
				for (int i = 0; i < CharacterDataExtensions.GetCustomStatsRegistry(val).GetOrCreate<StandardStats>().BlocksWhenRecharge; i++)
				{
					float num = (float)ExtensionMethods.GetFieldValue((object)__instance, "timeBetweenBlocks");
					float num2 = (float)i * num;
					((MonoBehaviour)__instance).StartCoroutine("DelayBlock", (object)num2);
				}
				BlockPatch.BlockRechargeAlreadyTriggered[__instance] = false;
			}
		}
	}
}
namespace AALUND13Cards.Standard.Cards
{
	public class StandardStats : ICustomStats
	{
		public float secondToDealDamage;

		public bool dealDamage = true;

		public int BlocksWhenRecharge;

		public float StunBlockTime;

		public Rarity MaxRarityForCurse;

		public float DamageReduction;

		public void ResetStats()
		{
			secondToDealDamage = 0f;
			dealDamage = true;
			BlocksWhenRecharge = 0;
			StunBlockTime = 0f;
			MaxRarityForCurse = null;
			DamageReduction = 0f;
		}
	}
}
namespace AALUND13Cards.Standard.Cards.StatModifers
{
	public class StandardStatModifers : CustomStatModifers
	{
		[Header("Curses Stats")]
		public bool SetMaxRarityForCurse;

		public CardRarity MaxRarityForCurse;

		[Header("Blocks Stats")]
		public int BlocksWhenRecharge;

		public float StunBlockTime;

		[Header("Uncategorized Stats")]
		public float SecondToDealDamage;

		public override void Apply(Player player)
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			StandardStats orCreate = CharacterDataExtensions.GetCustomStatsRegistry(player.data).GetOrCreate<StandardStats>();
			if (SecondToDealDamage > 0f)
			{
				orCreate.dealDamage = false;
			}
			orCreate.secondToDealDamage += SecondToDealDamage;
			if (SetMaxRarityForCurse)
			{
				Rarity rarity = RarityUtils.GetRarity(((object)(CardRarity)(ref MaxRarityForCurse)).ToString());
				orCreate.MaxRarityForCurse = RarityUtils.GetRarityData(rarity);
			}
			orCreate.BlocksWhenRecharge += BlocksWhenRecharge;
			orCreate.StunBlockTime += StunBlockTime;
		}
	}
}