Decompiled source of AALUND13 Cards v1.8.0

plugins/AALUND13_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 System.Security;
using System.Security.Permissions;
using AALUND13Card;
using AALUND13Card.Armors;
using AALUND13Card.Cards;
using AALUND13Card.Cards.Effects;
using AALUND13Card.Extensions;
using AALUND13Card.Handlers;
using AALUND13Card.Handlers.ExtraPickHandlers;
using AALUND13Card.MonoBehaviours;
using AALUND13Card.MonoBehaviours.Soulstreak;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using JARL;
using JARL.Armor;
using JARL.Armor.Bases;
using JARL.Armor.Utlis;
using JARL.Bases;
using JARL.Utils;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.GameModes;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.Utils;
using ModsPlus;
using Photon.Pun;
using RandomCardsGenerators;
using RandomCardsGenerators.StatsGroup;
using Sonigon;
using SoundImplementation;
using TMPro;
using TabInfo.Utils;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils.UI;
using UnityEngine;
using UnityEngine.Events;
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 AALUND13_Card.MonoBehaviours
{
	public class CardFactoryMono : MonoBehaviour, IPickEndHookHandler
	{
		public Player Player;

		public Gun Gun;

		public GunAmmo GunAmmo;

		public CharacterData Data;

		public HealthHandler Health;

		public Gravity Gravity;

		public Block Block;

		public 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 < Player.data.GetAdditionalData().RandomCardsAtStart; i++)
			{
				if (Random.Range(0f, 1f) < 0.7f)
				{
					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
				{
					AACardsGenerators.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 true;
		}
	}
}
namespace AALUND13Card
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.aalund13.rounds.aalund13_cards", "AALUND13 Cards", "1.8.0")]
	[BepInProcess("Rounds.exe")]
	public class AALUND13_Cards : BaseUnityPlugin
	{
		internal const string ModInitials = "AAC";

		internal const string CurseInitials = "AAC (Curse)";

		internal const string ModId = "com.aalund13.rounds.aalund13_cards";

		internal const string ModName = "AALUND13 Cards";

		internal const string Version = "1.8.0";

		internal static List<BaseUnityPlugin> Plugins;

		internal static ManualLogSource ModLogger;

		internal static AssetBundle Assets;

		public static GameObject BlankCardPrefab;

		public static GameObject CorruptedCardFancyIconPrefab;

		public static CardResgester CardResgester;

		public static CardCategory SoulstreakClassCards;

		public static Material PixelateEffectMaterial;

		public static Material ScanEffectMaterial;

		public static AALUND13_Cards Instance { get; private set; }

		public void Awake()
		{
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			ModLogger = ((BaseUnityPlugin)this).Logger;
			ConfigHandler.RegesterMenu(((BaseUnityPlugin)this).Config);
			Assets = AssetUtils.LoadAssetBundleFromResources("aacardassets", typeof(AALUND13_Cards).Assembly);
			if ((Object)(object)Assets == (Object)null)
			{
				throw new Exception("Failed to load asset bundle");
			}
			BlankCardPrefab = Assets.LoadAsset<GameObject>("__AAC__Blank");
			CorruptedCardFancyIconPrefab = Assets.LoadAsset<GameObject>("I_Corrupted");
			PixelateEffectMaterial = Assets.LoadAsset<Material>("PixelateEffectMaterial");
			ScanEffectMaterial = Assets.LoadAsset<Material>("ScanEffectMaterial");
			AACardsGenerators.RegisterGenerators();
			new Harmony("com.aalund13.rounds.aalund13_cards").PatchAll();
		}

		public void Start()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			Plugins = (List<BaseUnityPlugin>)typeof(Chainloader).GetField("_plugins", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
			CardResgester = Assets.LoadAsset<GameObject>("ModCards").GetComponent<CardResgester>();
			CardResgester.RegisterCards<AALUND13_Cards>("AAC");
			DeathHandler.OnPlayerDeath += new DeathHandlerDelegate(OnPlayerDeath);
			ArmorFramework.RegisterArmorType<SoulArmor>();
			ArmorFramework.RegisterArmorType<BattleforgedArmor>();
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => ExtraCardPickHandler.HandleExtraPicks()));
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)OnGameStart);
			GameModeManager.AddHook("PickStart", (Func<IGameModeHandler, IEnumerator>)OnPickStart);
			if (Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "com.willuwontu.rounds.tabinfo"))
			{
				TabinfoInterface.Setup();
			}
			((Component)this).gameObject.AddComponent<DelayDamageHandler>();
		}

		private IEnumerator OnGameStart(IGameModeHandler gameModeHandler)
		{
			foreach (Player player in PlayerManager.instance.players)
			{
				if (PhotonNetwork.IsMasterClient || PhotonNetwork.OfflineMode)
				{
					player.data.GetAdditionalData().Souls = 0u;
				}
			}
			yield break;
		}

		private IEnumerator OnPickStart(IGameModeHandler gameModeHandler)
		{
			foreach (Player player in PlayerManager.instance.players)
			{
				if (PhotonNetwork.IsMasterClient || PhotonNetwork.OfflineMode)
				{
					bool flag = gameModeHandler.GetRoundWinners().Contains(player.teamID);
					if (player.data.GetAdditionalData().ExtraCardPicks > 0 && !flag)
					{
						ExtraCardPickHandler.AddExtraPick<ExtraPickHandler>(player, player.data.GetAdditionalData().ExtraCardPicks);
					}
				}
			}
			yield break;
		}

		private void OnPlayerDeath(Player player, Dictionary<Player, DamageInfo> playerDamageInfos)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((Component)player).GetComponent<DelayDamageHandler>() != (Object)null)
			{
				((MonoBehaviour)((Component)player).GetComponent<DelayDamageHandler>()).StopAllCoroutines();
			}
			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)player.data.GetAdditionalData().Souls * 0.5f));
					}
				}
			}
			((Component)player).GetComponentInChildren<SoulstreakMono>()?.ResetSouls();
			if ((Object)(object)((Component)player).GetComponentInChildren<SoulstreakMono>() == (Object)null)
			{
				player.data.GetAdditionalData().Souls = 0u;
			}
		}
	}
	public enum AACardsGeneratorType
	{
		CardFactoryGenerator
	}
	internal class AACardsGenerators
	{
		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 TabinfoInterface
	{
		public static void Setup()
		{
			StatCategory obj = TabInfoManager.RegisterCategory("AA Stats", 6);
			TabInfoManager.RegisterStat(obj, "Random Cards At Start", (Func<Player, bool>)((Player p) => p.data.GetAdditionalData().RandomCardsAtStart != 0), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().RandomCardsAtStart}"));
			TabInfoManager.RegisterStat(obj, "Extra Card Picks", (Func<Player, bool>)((Player p) => p.data.GetAdditionalData().ExtraCardPicks != 0), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().ExtraCardPicks}"));
			TabInfoManager.RegisterStat(obj, "Delay Damage", (Func<Player, bool>)((Player p) => p.data.GetAdditionalData().secondToDealDamage != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().secondToDealDamage} seconds"));
			TabInfoManager.RegisterStat(obj, "DPS", (Func<Player, bool>)((Player _) => true), (Func<Player, string>)((Player p) => $"{p.GetDPS()}"));
			StatCategory obj2 = TabInfoManager.RegisterCategory("Soulstreak Stats", 7);
			TabInfoManager.RegisterStat(obj2, "Max Health Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().SoulStreakStats.MaxHealth != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().SoulStreakStats.MaxHealth * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Player Size Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().SoulStreakStats.PlayerSize != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().SoulStreakStats.PlayerSize * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Movement Speed Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().SoulStreakStats.MovementSpeed != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().SoulStreakStats.MovementSpeed * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Attack Speed Pre Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().SoulStreakStats.AttackSpeed != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().SoulStreakStats.AttackSpeed * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Damage Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().SoulStreakStats.Damage != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().SoulStreakStats.Damage * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Bullet Speed Per Kill", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().SoulStreakStats.BulletSpeed != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().SoulStreakStats.BulletSpeed * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Soul Armor Percentage", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().SoulStreakStats.SoulArmorPercentage != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().SoulStreakStats.SoulArmorPercentage * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Soul Armor Percentage Regen Rate", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().SoulStreakStats.SoulArmorPercentageRegenRate != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().SoulStreakStats.SoulArmorPercentageRegenRate * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Soul Drain DPS Factor", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().SoulStreakStats.SoulDrainDPSFactor != 0f), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().SoulStreakStats.SoulDrainDPSFactor * 100f:0}%"));
			TabInfoManager.RegisterStat(obj2, "Souls", (Func<Player, bool>)((Player p) => (Object)(object)((Component)p).GetComponentInChildren<SoulstreakMono>() != (Object)null && p.data.GetAdditionalData().Souls != 0), (Func<Player, string>)((Player p) => $"{p.data.GetAdditionalData().Souls}"));
		}
	}
	public static class LoggerUtils
	{
		public static bool logging = ConfigHandler.DebugMode.Value;

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

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

		public static void LogError(string message)
		{
			AALUND13_Cards.ModLogger.LogError((object)message);
		}
	}
}
namespace AALUND13Card.Utils
{
	public static class RandomSyncSeed
	{
		private static readonly Random Random = new Random();

		public static Dictionary<string, Action<SyncedRandomContext>> SyncedSeeds = new Dictionary<string, Action<SyncedRandomContext>>();

		public static void InvokeWithSeed(string target, int seed, params object[] additionalParams)
		{
			NetworkingManager.RPC(typeof(RandomSyncSeed), "RPCA_SyncSeed", new object[3] { seed, target, additionalParams });
		}

		public static void Invoke(string target, params object[] additionalParams)
		{
			NetworkingManager.RPC(typeof(RandomSyncSeed), "RPCA_SyncSeed", new object[3]
			{
				Random.Next(),
				target,
				additionalParams
			});
		}

		[UnboundRPC]
		private static void RPCA_SyncSeed(int seed, string target, object[] additionalParams)
		{
			if (SyncedSeeds.ContainsKey(target))
			{
				SyncedSeeds[target](new SyncedRandomContext(seed, additionalParams));
			}
		}

		public static void RegisterSyncedRandom(string target, Action<SyncedRandomContext> action)
		{
			SyncedSeeds.Add(target, action);
		}
	}
	public class SyncedRandomContext
	{
		public Random Random { get; private set; }

		public object[] Parameters { get; private set; }

		public SyncedRandomContext(int seed, object[] parameters)
		{
			Random = new Random(seed);
			Parameters = parameters;
		}
	}
}
namespace AALUND13Card.Patches
{
	[HarmonyPatch(typeof(Cards), "PlayerIsAllowedCard")]
	public class AllowedCardPatch
	{
		private static void Postfix(Player player, CardInfo card, ref bool __result, Cards __instance)
		{
			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.extraPicks[player][0].OnExtraPickStart(player, card);
				__result &= flag;
			}
		}
	}
	[HarmonyPatch(typeof(ApplyCardStats), "ApplyStats")]
	public class ApplyCardStatsPatch
	{
		public static void Postfix(ApplyCardStats __instance, Player ___playerToUpgrade)
		{
			AAStatModifers component = ((Component)__instance).gameObject.GetComponent<AAStatModifers>();
			if ((Object)(object)component != (Object)null)
			{
				component.Apply(___playerToUpgrade);
			}
		}
	}
	[HarmonyPatch(typeof(CardChoice))]
	public class CardChoicePatch
	{
		[HarmonyPatch("IDoEndPick")]
		private static void Postfix(GameObject pickedCard, int theInt, int pickId)
		{
			Player playerWithID = ExtensionMethods.GetPlayerWithID(PlayerManager.instance, pickId);
			if (!((Object)(object)playerWithID == (Object)null) && (Object)(object)ExtraCardPickHandler.currentPlayer != (Object)null && ExtraCardPickHandler.extraPicks.ContainsKey(playerWithID) && ExtraCardPickHandler.extraPicks[playerWithID].Count > 0)
			{
				ExtraCardPickHandler.extraPicks[playerWithID][0].OnExtraPick(playerWithID, pickedCard.GetComponent<CardInfo>());
			}
		}
	}
	[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();
			val.GetAdditionalData().Reset();
			if (ExtraCardPickHandler.extraPicks.ContainsKey(val.player))
			{
				ExtraCardPickHandler.extraPicks[val.player].Clear();
			}
			Camera main = Camera.main;
			if ((Object)(object)main != (Object)null)
			{
				Effect[] components = ((Component)main).GetComponents<Effect>();
				for (int i = 0; i < components.Length; i++)
				{
					Object.Destroy((Object)(object)components[i]);
				}
			}
		}
	}
	[HarmonyPatch(typeof(HealthHandler))]
	public 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//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_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)
			AALUND13CardCharacterDataAdditionalData additionalData = CharacterDataExtensions.GetAdditionalData((CharacterData)Traverse.Create((object)__instance).Field("data").GetValue());
			if (additionalData.secondToDealDamage > 0f && !additionalData.dealDamage)
			{
				Vector2 damage2 = default(Vector2);
				((Vector2)(ref damage2))..ctor(damage.x, damage.y);
				ExtensionMethods.GetOrAddComponent<DelayDamageHandler>(((Component)__instance).gameObject, false).DelayDamage(damage2, position, blinkColor, damagingWeapon, damagingPlayer, healthRemoval, lethal, ignoreBlock);
				damage = Vector2.zero;
			}
			else if (additionalData.dealDamage)
			{
				additionalData.dealDamage = false;
			}
		}
	}
}
namespace AALUND13Card.MonoBehaviours
{
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	public class Effect : 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);
		}
	}
	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 = player.data.GetAdditionalData().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 = player.GetDPS();
					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;
		}
	}
	[Flags]
	public enum AbilityType
	{
		Armor = 1
	}
	[Serializable]
	public class SoulStreakStats
	{
		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 AbilityType AbilityType;
	}
	public class SoulstreakMono : MonoBehaviour, IBattleStartHookHandler, IPointEndHookHandler
	{
		private Player player;

		private ArmorHandler armorHandler;

		public bool CanResetKills = true;

		public bool AbilityActive;

		public float AbilityCooldown;

		public GameObject SoulsCounter;

		public GameObject SoulsCounterGUI;

		private SoulStreakStats SoulstreakStats => player.data.GetAdditionalData().SoulStreakStats;

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

		private uint Souls
		{
			get
			{
				return player.data.GetAdditionalData().Souls;
			}
			set
			{
				player.data.GetAdditionalData().Souls = value;
			}
		}

		private void Start()
		{
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			player = ((Component)((Component)this).gameObject.transform.parent).GetComponent<Player>();
			armorHandler = ((Component)player).GetComponent<ArmorHandler>();
			SoulsCounter = Object.Instantiate<GameObject>(SoulsCounter);
			if (player.data.view.IsMine && !((Behaviour)((Component)player).GetComponent<PlayerAPI>()).enabled)
			{
				SoulsCounterGUI = Object.Instantiate<GameObject>(SoulsCounterGUI);
				SoulsCounterGUI.transform.SetParent(((Component)player).transform.parent);
			}
			player.data.SetWobbleObjectChild(SoulsCounter.transform);
			SoulsCounter.transform.localPosition = Vector2.op_Implicit(new Vector2(0f, 0.3f));
			InterfaceGameModeHooksManager.instance.RegisterHooks((object)this);
		}

		private void OnDestroy()
		{
			if (player.data.view.IsMine && !((Behaviour)((Component)player).GetComponent<PlayerAPI>()).enabled)
			{
				Object.Destroy((Object)(object)SoulsCounterGUI);
			}
			Object.Destroy((Object)(object)SoulsCounter);
			if ((Object)(object)((Component)player).gameObject.GetComponent<SoulstreakEffect>() != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)player).gameObject.GetComponent<SoulstreakEffect>());
			}
			InterfaceGameModeHooksManager.instance.RemoveHooks((object)this);
		}

		private void Update()
		{
			if (player.data.isPlaying)
			{
				AbilityCooldown = Mathf.Max(AbilityCooldown - Time.deltaTime, 0f);
				if (armorHandler.GetArmorByType<SoulArmor>().CurrentArmorValue <= 0f && armorHandler.GetArmorByType<SoulArmor>().MaxArmorValue > 0f)
				{
					armorHandler.GetArmorByType<SoulArmor>().MaxArmorValue = 0f;
					AbilityCooldown = 10f;
					AbilityActive = false;
				}
			}
			((TMP_Text)SoulsCounter.GetComponent<TextMeshPro>()).text = SoulsString;
			if (player.data.view.IsMine && !((Behaviour)((Component)player).GetComponent<PlayerAPI>()).enabled)
			{
				((TMP_Text)SoulsCounterGUI.GetComponentInChildren<TextMeshProUGUI>()).text = SoulsString;
			}
		}

		public void BlockAbility()
		{
			if (SoulstreakStats.AbilityType == AbilityType.Armor && !AbilityActive && AbilityCooldown == 0f)
			{
				ArmorBase armorByType = armorHandler.GetArmorByType<SoulArmor>();
				armorByType.MaxArmorValue = player.data.maxHealth * SoulstreakStats.SoulArmorPercentage * (float)(Souls + 1);
				armorByType.ArmorRegenerationRate = armorByType.MaxArmorValue * SoulstreakStats.SoulArmorPercentageRegenRate;
				armorByType.CurrentArmorValue = armorByType.MaxArmorValue;
				AbilityActive = true;
			}
		}

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

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

		public void OnBattleStart()
		{
			CanResetKills = true;
			ExtensionMethods.GetOrAddComponent<SoulstreakEffect>(((Component)player).gameObject, false).ApplyStats();
		}

		public void OnPointEnd()
		{
			CanResetKills = false;
			armorHandler.GetArmorByType<SoulArmor>().MaxArmorValue = 0f;
		}
	}
}
namespace AALUND13Card.MonoBehaviours.Soulstreak
{
	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 soulStreakStats = base.data.GetAdditionalData().SoulStreakStats;
			uint souls = base.data.GetAdditionalData().Souls;
			((ReversibleEffect)this).ClearModifiers(true);
			base.characterDataModifier.maxHealth_mult = 1f + (soulStreakStats.MaxHealth - 1f) * (float)souls;
			base.characterStatModifiersModifier.sizeMultiplier_mult = 1f + (soulStreakStats.PlayerSize - 1f) * (float)souls;
			base.characterStatModifiersModifier.movementSpeed_mult = 1f + (soulStreakStats.MovementSpeed - 1f) * (float)souls;
			base.gunStatModifier.attackSpeed_mult = 1f + (soulStreakStats.AttackSpeed - 1f) * (float)souls;
			base.gunStatModifier.damage_mult = 1f + (soulStreakStats.Damage - 1f) * (float)souls;
			base.gunStatModifier.projectileSpeed_mult = 1f + (soulStreakStats.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);
		}
	}
}
namespace AALUND13Card.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", (UnityAction)obj, (Action<GameObject>)NewGui, (GameObject)null, false);
			DebugMode = config.Bind<bool>("AALUND13 Cards", "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 class DelayDamageHandler : MonoBehaviour, IBattleStartHookHandler
	{
		public Player player;

		public void Awake()
		{
			player = ((Component)this).GetComponent<Player>();
			InterfaceGameModeHooksManager.instance.RegisterHooks((object)this);
		}

		public void DelayDamage(Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, bool lethal, bool ignoreBlock)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)this, player.data.GetAdditionalData().secondToDealDamage, (Action)delegate
			{
				//IL_0031: 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_003d: Unknown result type (might be due to invalid IL or missing references)
				player.data.GetAdditionalData().dealDamage = true;
				player.data.healthHandler.DoDamage(damage, position, blinkColor, damagingWeapon, damagingPlayer, healthRemoval, lethal, ignoreBlock);
			});
		}

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

		public void OnBattleStart()
		{
			((MonoBehaviour)this).StopAllCoroutines();
		}
	}
	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
	{
		internal static Dictionary<Player, List<ExtraPickHandler>> extraPicks = new Dictionary<Player, List<ExtraPickHandler>>();

		public static Player currentPlayer;

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

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

		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)
		{
			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 List<ExtraPickHandler>());
				}
				for (int i = 0; i < picks; i++)
				{
					extraPicks[val].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)
			{
				return;
			}
			ExtraPickHandler item = (ExtraPickHandler)Activator.CreateInstance(type);
			if (extraPicks.ContainsKey(val))
			{
				for (int i = 0; i < picks; i++)
				{
					extraPicks[val].Remove(item);
				}
			}
		}

		internal static IEnumerator HandleExtraPicks()
		{
			Player[] array = PlayerManager.instance.players.ToArray();
			foreach (Player val in array)
			{
				if (extraPicks.ContainsKey(val) && extraPicks[val].Count > 0)
				{
					yield return HandleExtraPickForPlayer(val);
				}
			}
			currentPlayer = null;
		}

		private static IEnumerator HandleExtraPickForPlayer(Player player)
		{
			currentPlayer = player;
			yield return GameModeManager.TriggerHook("PlayerPickStart");
			CardChoiceVisuals.instance.Show((from i in Enumerable.Range(0, PlayerManager.instance.players.Count)
				where PlayerManager.instance.players[i].playerID == player.playerID
				select i).First(), true);
			yield return CardChoice.instance.DoPick(1, player.playerID, (PickerType)1);
			yield return (object)new WaitForSecondsRealtime(0.1f);
			if (extraPicks.ContainsKey(player) && extraPicks[player].Count > 0)
			{
				extraPicks[player].RemoveAt(0);
			}
			yield return GameModeManager.TriggerHook("PlayerPickEnd");
		}
	}
}
namespace AALUND13Card.Handlers.ExtraPickHandlers
{
	public class SteelPickHandler : ExtraPickHandler
	{
		public override bool OnExtraPickStart(Player player, CardInfo card)
		{
			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 AALUND13Card.Extensions
{
	public class AALUND13CardCharacterDataAdditionalData
	{
		public float secondToDealDamage;

		public bool dealDamage = true;

		public SoulStreakStats SoulStreakStats = new SoulStreakStats();

		public uint Souls;

		public int RandomCardsAtStart;

		public int ExtraCardPicks;

		public void Reset()
		{
			secondToDealDamage = 0f;
			dealDamage = true;
			SoulStreakStats = new SoulStreakStats();
			RandomCardsAtStart = 0;
			ExtraCardPicks = 0;
		}
	}
	public static class CharacterDataExtensions
	{
		public static readonly ConditionalWeakTable<CharacterData, AALUND13CardCharacterDataAdditionalData> data = new ConditionalWeakTable<CharacterData, AALUND13CardCharacterDataAdditionalData>();

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

		public static void AddData(this CharacterData block, AALUND13CardCharacterDataAdditionalData value)
		{
			try
			{
				data.Add(block, 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;
			GunAmmo componentInChildren = ((Component)player.data.weaponHandler.gun).GetComponentInChildren<GunAmmo>();
			int maxAmmo = componentInChildren.maxAmmo;
			int numberOfProjectiles = player.data.weaponHandler.gun.numberOfProjectiles;
			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 * numberOfProjectiles;
			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);
			float num9 = 1f / num8;
			return num * (float)num6 * (float)num5 * num9 / 1.33333f;
		}
	}
	public static class RandomExtension
	{
		public static float NextFloat(this Random random, float minValue, float maxValue)
		{
			return (float)random.NextDouble() * (maxValue - minValue) + minValue;
		}
	}
}
namespace AALUND13Card.Cards
{
	public class AACustomCard : CustomUnityCard
	{
		public override void OnSetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			LoggerUtils.LogInfo("[" + ((CustomCard)this).GetModName() + "][Card] " + ((CustomCard)this).GetTitle() + " has been setup.");
		}

		public override void OnReassignCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			AAStatModifers component = ((Component)this).GetComponent<AAStatModifers>();
			if ((Object)(object)component != (Object)null)
			{
				component.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 enum ExtraPicksType
	{
		None,
		Normal,
		Steel
	}
	public class AAStatModifers : MonoBehaviour
	{
		[Header("Soulstreak Stats")]
		public float MaxHealth;

		public float PlayerSize;

		public float MovementSpeed;

		public float AttackSpeed;

		public float Damage;

		public float BulletSpeed;

		public float SoulArmorPercentage;

		public float SoulArmorPercentageRegenRate;

		public float SoulDrainDamageMultiply;

		public float SoulDrainLifestealMultiply;

		public AbilityType AbilityType;

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

		[Header("Armors Stats")]
		public float BattleforgedArmor;

		[Header("Extra Picks")]
		public int ExtraPicks;

		public ExtraPicksType ExtraPicksType;

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

		public int ExtraCardPicks;

		public void Apply(Player player)
		{
			AALUND13CardCharacterDataAdditionalData additionalData = player.data.GetAdditionalData();
			additionalData.SoulStreakStats.MaxHealth += MaxHealth;
			additionalData.SoulStreakStats.PlayerSize += PlayerSize;
			additionalData.SoulStreakStats.MovementSpeed += MovementSpeed;
			additionalData.SoulStreakStats.AttackSpeed += AttackSpeed;
			additionalData.SoulStreakStats.Damage += Damage;
			additionalData.SoulStreakStats.BulletSpeed += BulletSpeed;
			additionalData.SoulStreakStats.SoulArmorPercentage += SoulArmorPercentage;
			additionalData.SoulStreakStats.SoulArmorPercentageRegenRate += SoulArmorPercentageRegenRate;
			additionalData.SoulStreakStats.SoulDrainDPSFactor += SoulDrainDamageMultiply;
			additionalData.SoulStreakStats.SoulDrainLifestealMultiply += SoulDrainLifestealMultiply;
			additionalData.SoulStreakStats.AbilityType |= AbilityType;
			if (SecondToDealDamage > 0f)
			{
				additionalData.dealDamage = false;
			}
			additionalData.secondToDealDamage += SecondToDealDamage;
			additionalData.RandomCardsAtStart += RandomCardsAtStart;
			additionalData.ExtraCardPicks += ExtraCardPicks;
			if (BattleforgedArmor > 0f)
			{
				ArmorFramework.ArmorHandlers[player].AddArmor<BattleforgedArmor>(BattleforgedArmor, 0f, 0f, (ArmorReactivateType)0, 0.5f);
			}
			ExtraPickHandler extraPickHandler = GetExtraPickHandler(ExtraPicksType);
			if (extraPickHandler != null && ExtraPicks > 0 && player.data.view.IsMine)
			{
				ExtraCardPickHandler.AddExtraPick(extraPickHandler, player, ExtraPicks);
			}
		}

		public void OnReassign(Player player)
		{
			player.data.GetAdditionalData().ExtraCardPicks += ExtraCardPicks;
		}

		public ExtraPickHandler GetExtraPickHandler(ExtraPicksType type)
		{
			return type switch
			{
				ExtraPicksType.Normal => new ExtraPickHandler(), 
				ExtraPicksType.Steel => new SteelPickHandler(), 
				_ => null, 
			};
		}
	}
	public class CursesEffectCard : AACustomCard
	{
		public List<Material> PostProcessingEffects = new List<Material>();

		public override void OnRegister(CardInfo cardInfo)
		{
			CurseManager.instance.RegisterCurse(cardInfo);
		}

		public override void OnAddCard(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<Effect>().Material = postProcessingEffect;
			}
		}

		public override string GetModName()
		{
			return "AAC (Curse)";
		}
	}
}
namespace AALUND13Card.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);
	}
	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);
			}
		}
	}
}
namespace AALUND13Card.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 override void OnRegister()
		{
			base.ArmorTags.Add("CanArmorPierce");
			base.ArmorRegenCooldownSeconds = 5f;
		}
	}
	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 override void OnRespawn()
		{
			SoulstreakMono componentInChildren = ((Component)((ArmorBase)this).ArmorHandler).GetComponentInChildren<SoulstreakMono>();
			if ((Object)(object)componentInChildren != (Object)null)
			{
				base.MaxArmorValue = 0f;
				base.CurrentArmorValue = 0f;
				componentInChildren.AbilityCooldown = 0f;
				componentInChildren.AbilityActive = false;
			}
		}

		public override void OnRegister()
		{
			base.ArmorRegenCooldownSeconds = 5f;
		}
	}
}