using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; 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.Patches; 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 PickPhaseImprovements; using RarityLib.Utils; using Sonigon; using TMPro; using TabInfo.Utils; using ToggleCardsCategories; using UnboundLib; using UnboundLib.Cards; using UnboundLib.Extensions; using UnboundLib.GameModes; using UnboundLib.Utils; using UnboundLib.Utils.UI; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; using UnityEngine.UI.ProceduralImage; 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.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("AALUND13.Cards.Core", "AALUND13 Cards Core", "1.2.1")] [BepInProcess("Rounds.exe")] public class AAC_Core : BaseUnityPlugin { [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(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; ConstantDamageHandler.Instance.Reset(); 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 const string ModInitials = "AAC"; internal const string ModId = "AALUND13.Cards.Core"; internal const string ModName = "AALUND13 Cards Core"; internal const string Version = "1.2.1"; internal const string FullVersion = "2.2.0"; internal const bool IsBeta = false; public static List Plugins; internal static ManualLogSource ModLogger; internal static Harmony Harmony; 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) //IL_0020: Expected O, but got Unknown Instance = this; ModLogger = ((BaseUnityPlugin)this).Logger; Harmony = new Harmony("AALUND13.Cards.Core"); Harmony.PatchAll(); ToggleCardsCategoriesManager.instance.RegisterCategories("AAC"); AACMenu.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)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(); } CardBarHandlerExtensionsPatch.Patch(Harmony); GameModeManager.AddHook("GameStart", (Func)OnGameStart); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); NoLotteryCategories = (CardCategory[])(object)new CardCategory[2] { CustomCardCategories.instance.CardCategory("CardManipulation"), CustomCardCategories.instance.CardCategory("NoRandom") }; NoSteelCategories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("NoRemove") }; } [IteratorStateMachine(typeof(d__18))] private IEnumerator OnGameStart(IGameModeHandler gm) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0); } private void OnPlayerDeath(Player player, Dictionary playerDamageInfos) { if ((Object)(object)((Component)player).GetComponent() != (Object)null) { ((MonoBehaviour)((Component)player).GetComponent()).StopAllCoroutines(); } } } public static class AACMenu { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__3_0; public static UnityAction <>9__4_0; public static UnityAction <>9__7_0; public static UnityAction <>9__7_1; internal void b__3_0() { } internal void b__4_0() { } internal void b__7_0() { } internal void b__7_1(bool val) { DebugMode.Value = val; } } public static Action OnMenuRegister; internal static ConfigEntry DebugMode; private static GameObject ModulesMenu; internal 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__3_0; if (obj == null) { UnityAction val = delegate { }; <>c.<>9__3_0 = val; obj = (object)val; } Unbound.RegisterMenu("AALUND13 Cards", (UnityAction)obj, (Action)NewGui, (GameObject)null, false); DebugMode = config.Bind("AALUND13 Cards Core", "DebugMode", false, "Enabled or disabled Debug Mode"); } public static GameObject CreateModuleMenu(string moduleName) { //IL_003e: 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_0049: Expected O, but got Unknown LoggerUtils.LogInfo($"Is ModulesMenu null?: {(Object)(object)ModulesMenu == (Object)null}"); string obj = moduleName ?? ""; object obj2 = <>c.<>9__4_0; if (obj2 == null) { UnityAction val = delegate { }; <>c.<>9__4_0 = val; obj2 = (object)val; } GameObject val2 = MenuHandler.CreateMenu(obj, (UnityAction)obj2, ModulesMenu, 50, true, true, ((Component)ModulesMenu.transform.parent).gameObject, true, -1); TextMeshProUGUI val3 = default(TextMeshProUGUI); MenuHandler.CreateText("" + moduleName + "", val2, ref val3, 70, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); return val2; } public static GameObject CreateModuleMenuWithReadmeGenerator(string moduleName, string version, CardResgester cardResgester) { return CreateModuleMenu(moduleName); } public static void AddBlank(GameObject menu, int space = 30) { TextMeshProUGUI val = default(TextMeshProUGUI); MenuHandler.CreateText(" ", menu, ref val, space, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); } private static void NewGui(GameObject menu) { //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__7_0; if (obj == null) { UnityAction val2 = delegate { }; <>c.<>9__7_0 = val2; obj = (object)val2; } ModulesMenu = MenuHandler.CreateMenu("Modules", (UnityAction)obj, menu, 50, true, true, ((Component)menu.transform.parent).gameObject, true, -1); MenuHandler.CreateToggle(DebugMode.Value, "<#c41010> Debug Mode", menu, (UnityAction)delegate(bool val) { DebugMode.Value = val; }, 30, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null); OnMenuRegister?.Invoke(); } } 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 p) => p.data.GetAdditionalData().BlockPircePercent != 0f), (Func)((Player p) => $"{p.data.GetAdditionalData().BlockPircePercent * 100f:0}%")); TabInfoManager.RegisterStat(orCreateCategory, "Damage Per Seconds", (Func)((Player _) => true), (Func)((Player p) => $"{p.GetDPS()}")); TabInfoManager.RegisterStat(orCreateCategory, "Bullets Per Seconds", (Func)((Player _) => true), (Func)((Player p) => $"{p.GetSPS()}")); } } public static class LoggerUtils { public static bool logging = AACMenu.DebugMode.Value; public static void LogInfo(string message, bool bypassCheck = false) { if (logging || bypassCheck) { 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 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(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(); } 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 class AssetsUtils { public static AssetBundle LoadAssetBundle(string bundleName, Assembly assembly) { string fullName = assembly.FullName; LoggerUtils.LogInfo("Loading embedded asset bundle. Using assembly: " + fullName, bypassCheck: true); LoggerUtils.LogInfo("bundleName requested: '" + bundleName + "'", bypassCheck: true); string[] manifestResourceNames = assembly.GetManifestResourceNames(); LoggerUtils.LogInfo($"Found {manifestResourceNames.Length} embedded resource(s) in assembly:", bypassCheck: true); string[] array = manifestResourceNames; foreach (string text in array) { LoggerUtils.LogInfo(" '" + text + "'", bypassCheck: true); } string text2 = null; try { text2 = manifestResourceNames.Single((string str) => str.EndsWith(bundleName)); LoggerUtils.LogInfo("Matched resource name: '" + text2 + "'", bypassCheck: true); } catch (Exception ex) { LoggerUtils.LogError("Exception while matching resource name: " + ex.GetType().Name + " — " + ex.Message); } if (text2 == null) { LoggerUtils.LogError("No resource name ending with '" + bundleName + "' was found."); return null; } try { using Stream stream = assembly.GetManifestResourceStream(text2); if (stream == null) { LoggerUtils.LogError("GetManifestResourceStream returned null for resource '" + text2 + "'"); return null; } AssetBundle obj = AssetBundle.LoadFromStream(stream); if ((Object)(object)obj == (Object)null) { LoggerUtils.LogError("AssetBundle.LoadFromStream returned null for resource '" + text2 + "'"); } else { LoggerUtils.LogInfo("Successfully loaded AssetBundle from resource '" + text2 + "'", bypassCheck: true); } return obj; } catch (Exception ex2) { LoggerUtils.LogError("Exception loading from stream: " + ex2.GetType().Name + " — " + ex2.Message); return null; } } } public interface ICustomStats { void ResetStats(); } public class CustomStatsRegistry : IEnumerable, IEnumerable { private readonly Dictionary statsMap = new Dictionary(); public bool Exist() where T : ICustomStats { return statsMap.ContainsKey(typeof(T)); } public T Get() where T : ICustomStats { return (T)statsMap[typeof(T)]; } public T Add(T customStatsHandler) where T : ICustomStats { if (Exist()) { 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() 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 GetEnumerator() { return statsMap.Values.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class PhotonPrefabPool : MonoBehaviour { public List Prefabs = new List(); 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 cardPickedInPickPhase = new List(); public IReadOnlyList CardPickedInPickPhase => cardPickedInPickPhase.AsReadOnly(); public CardInfo LastPickedCard { get { if (cardPickedInPickPhase.Count <= 0) { return null; } return cardPickedInPickPhase[cardPickedInPickPhase.Count - 1]; } } 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 r) => r.Value.calculatedRarity); float num2 = Random.Range(0f, num); Rarity result = null; foreach (KeyValuePair rarity in RarityUtils.Rarities) { num2 -= rarity.Value.calculatedRarity; if (num2 <= 0f) { result = rarity.Value; break; } } return result; } } internal static class ReadmeGenerator { public static string CreateReadme(string modName, string version, List cardInfos) { string[] source = new string[2] { "Classes", "Extra Cards" }; new List(); StringBuilder stringBuilder = new StringBuilder(); bool flag = true; stringBuilder.AppendLine("# " + modName + " [v" + version + "]"); stringBuilder.AppendLine($"{modName} introduces {cardInfos.Count} cards developed by AALUND13. "); stringBuilder.AppendLine("If you encounter any bugs, please report them in the [issues](https://github.com/AALUND13/AALUND13-Cards/issues) tab."); stringBuilder.AppendLine("

Cards:

"); Dictionary> cardWithCategories = GetCardWithCategories(cardInfos); int num = cardInfos.Max((CardInfo c) => c.cardName.Length); foreach (KeyValuePair> item in cardWithCategories) { Stack stack = new Stack(item.Key.Split(new char[1] { '/' })); string text = stack.Pop(); while (stack.Count > 0) { string text2 = stack.Pop(); if (source.Contains(text2)) { text = text2 + " - " + text; } } if (!flag) { stringBuilder.AppendLine("
"); } stringBuilder.AppendLine("" + text + ":"); stringBuilder.AppendLine("
");
				int num2 = 4;
				int totalWidth = num + 2;
				for (int i = 0; i < item.Value.Count; i++)
				{
					string cardName = item.Value[i].cardName;
					stringBuilder.Append("- " + cardName.PadRight(totalWidth));
					if ((i + 1) % num2 == 0 || i == item.Value.Count - 1)
					{
						stringBuilder.AppendLine();
					}
				}
				stringBuilder.AppendLine("
"); flag = false; } return stringBuilder.ToString(); } private static Dictionary> GetCardWithCategories(List cardInfos) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary { { "Devil/Outcomes", "Devil" } }; Dictionary> dictionary2 = new Dictionary>(StringComparer.OrdinalIgnoreCase); foreach (CardInfo cardInfo in cardInfos) { IToggleCardCategory component = ((Component)cardInfo).GetComponent(); string key = ((component != null) ? component.GetCardCategoryInfo().Name : "Other"); if (dictionary.TryGetValue(key, out var value)) { key = value; } if (!dictionary2.TryGetValue(key, out var value2)) { value2 = (dictionary2[key] = new List()); } value2.Add(((Component)cardInfo).GetComponent()); } return dictionary2.OrderBy>, string>((KeyValuePair> kvp) => kvp.Key, StringComparer.OrdinalIgnoreCase).ToDictionary((KeyValuePair> kvp) => kvp.Key, (KeyValuePair> kvp) => kvp.Value); } } } namespace AALUND13Cards.Core.Patches { [HarmonyPatch(typeof(ExtraPlayerSkins))] internal class AALUND13Team { private static PlayerSkin SkinWhite; internal static readonly PlayerSkin White = new PlayerSkin { color = new Color(0.8f, 0.8f, 0.8f, 1f), backgroundColor = new Color(0.8f, 0.8f, 0.8f, 1f), winText = new Color(0.8f, 0.8f, 0.8f, 1f), particleEffect = new Color(0.8f, 0.8f, 0.8f, 1f) }; public const int TeamID = 131; [HarmonyPatch("GetTeamColorName")] [HarmonyPostfix] public static void PatchName(int teamID, ref string __result) { if (teamID == 131) { __result = "AALUND13"; } } [HarmonyPatch("GetPlayerSkinColors")] [HarmonyPrefix] public static bool PatchGetSkin(int colorID, ref PlayerSkin __result) { if (colorID != 131) { return true; } if ((Object)(object)SkinWhite == (Object)null) { SkinWhite = CreateSkins(colorID, White); } __result = SkinWhite; return false; } private static PlayerSkin CreateSkins(int colorID, PlayerSkin skinPrefab) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0069: 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_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_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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) PropertyInfo property = typeof(PlayerSkinBank).GetProperty("Instance", BindingFlags.Static | BindingFlags.NonPublic); PlayerSkinBank val = (PlayerSkinBank)((property != null) ? property.GetValue(null, null) : null); PlayerSkin component = ((Component)Object.Instantiate(((Object)(object)val != (Object)null) ? val.skins[colorID % 4].currentPlayerSkin : null)).gameObject.GetComponent(); Object.DontDestroyOnLoad((Object)(object)component); component.color = skinPrefab.color; component.backgroundColor = skinPrefab.backgroundColor; component.winText = skinPrefab.winText; component.particleEffect = skinPrefab.particleEffect; PlayerSkinParticle componentInChildren = ((Component)component).GetComponentInChildren(); MainModule main = ((Component)componentInChildren).GetComponent().main; MinMaxGradient startColor = ((MainModule)(ref main)).startColor; ((MinMaxGradient)(ref startColor)).colorMin = skinPrefab.backgroundColor; ((MinMaxGradient)(ref startColor)).colorMax = skinPrefab.color; ((MainModule)(ref main)).startColor = startColor; ExtensionMethods.SetFieldValue((object)componentInChildren, "startColor1", (object)skinPrefab.backgroundColor); ExtensionMethods.SetFieldValue((object)componentInChildren, "startColor2", (object)skinPrefab.color); return component; } } [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(); if (components != null && components.Length != 0) { CardCondition[] array = components; foreach (CardCondition cardCondition in array) { if (!((Object)(object)cardCondition == (Object)null) && !cardCondition.IsPlayerAllowedCard(player)) { __result = false; break; } } } if ((Object)(object)ExtraCardPickHandler.currentPlayer != (Object)null && ExtraCardPickHandler.extraPicks.ContainsKey(player) && ExtraCardPickHandler.extraPicks[player].Count > 0) { bool flag = ExtraCardPickHandler.activePickHandler.PickConditions(player, card); __result &= flag; } } } [HarmonyPatch(typeof(ApplyCardStats), "ApplyStats")] internal class ApplyCardStatsPatch { public static void Postfix(ApplyCardStats __instance, Player ___playerToUpgrade) { CustomStatModifers[] components = ((Component)__instance).gameObject.GetComponents(); 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(); 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); } } } public class CardBarHandlerExtensionsPatch { public static void Patch(Harmony harmony) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(CardBarHandlerExtensionsPatch), "CardBarColor", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(CardBarHandlerExtensions), "Rebuild", (Type[])null, (Type[])null); harmony.Patch((MethodBase)methodInfo2, (HarmonyMethod)null, new HarmonyMethod(methodInfo), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); LoggerUtils.LogInfo("Patch 'UnboundLib' CardBarHandlerExtensions.Rebuild method"); if (AAC_Core.Plugins.Exists((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "io.olavim.rounds.rwf")) { MethodInfo method = Type.GetType("RWF.CardBarHandlerExtensions, RoundsWithFriends").GetMethod("Rebuild"); harmony.Patch((MethodBase)method, (HarmonyMethod)null, new HarmonyMethod(methodInfo), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); LoggerUtils.LogInfo("Patch 'RWF' CardBarHandlerExtensions.Rebuild method"); } else { LoggerUtils.LogInfo("No 'RWF' CardBarHandlerExtensions.Rebuild method to patch"); } } public static void CardBarColor(CardBarHandler instance) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) int[] array = (from p in PlayerManager.instance.players where PlayerExtensions.GetAdditionalData(p).colorID == 131 select p.teamID).ToArray(); CardBar[] array2 = (CardBar[])ExtensionMethods.GetFieldValue((object)instance, "cardBars"); int[] array3 = array; foreach (int num in array3) { CardBar val = array2[num]; GameObject gameObject = ((Component)((Component)val).transform.GetChild(((Component)val).transform.childCount - 1)).gameObject; ProceduralImage[] componentsInChildren = gameObject.GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { ((Graphic)componentsInChildren[j]).color = Color.black; } ((Graphic)gameObject.GetComponentInChildren()).color = Color.white; } } } [HarmonyPatch(typeof(CardChoice))] internal class CardChoicePatch { [HarmonyPatch("IDoEndPick")] [HarmonyPriority(800)] private static void Postfix(GameObject pickedCard, int pickId) { if (!((Object)(object)ExtensionMethods.GetPlayerWithID(PlayerManager.instance, pickId) == (Object)null)) { PickCardTracker.instance.AddCardPickedInPickPhase(pickedCard.GetComponent()); } } } [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(); } } } [HarmonyPatch(typeof(DamageOverTime))] internal class DamageOverTimePatch { [HarmonyPatch("TakeDamageOverTime")] [HarmonyPrefix] public static void TakeDamageOverTimePrefix(DamageOverTime __instance, ref Vector2 damage, Vector2 position, float time, float interval, Color color, SoundEvent soundDamageOverTime, GameObject damagingWeapon, ref Player damagingPlayer, ref bool lethal) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //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) CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue(); if (!HealthHandlerPatch.TakeDamageRunning) { DamageInfo damageInfo = DamageEventHandler.TriggerDamageEvent(DamageEventHandler.DamageEventType.OnTakeDamageOvertime, val.player, damagingPlayer, damage, lethal); damage = damageInfo.Damage; lethal = damageInfo.IsLethal; damagingPlayer = damageInfo.DamagingPlayer; } } } [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, ref Player damagingPlayer, ref Vector2 damage, ref bool lethal) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) TakeDamageRunning = true; CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue(); DamageInfo damageInfo = DamageEventHandler.TriggerDamageEvent(DamageEventHandler.DamageEventType.OnTakeDamage, val.player, damagingPlayer, damage, lethal); damage = damageInfo.Damage; lethal = damageInfo.IsLethal; damagingPlayer = damageInfo.DamagingPlayer; } [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, ref Player damagingPlayer, bool healthRemoval, ref 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_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) CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue(); val.GetAdditionalData(); DamageInfo damageInfo = DamageEventHandler.TriggerDamageEvent(DamageEventHandler.DamageEventType.OnDoDamage, val.player, damagingPlayer, damage, lethal); damage = damageInfo.Damage; lethal = damageInfo.IsLethal; damagingPlayer = damageInfo.DamagingPlayer; } [HarmonyPatch("RPCA_Die_Phoenix")] [HarmonyPrefix] public static void PhoenixRevive(Player ___player, bool ___isRespawning, Vector2 deathDirection) { if (!___isRespawning && !___player.data.dead && DeathActionHandler.Instance.registeredReviveActions.TryGetValue(___player, out var value)) { value?.Invoke(); } } [HarmonyPatch("RPCA_Die")] [HarmonyPrefix] public static void TrueDeath(Player ___player, bool ___isRespawning, Vector2 deathDirection) { if (!___isRespawning && !___player.data.dead && DeathActionHandler.Instance.registeredTrueDeathActions.TryGetValue(___player, out var value)) { value?.Invoke(); } } } } 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(); 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(); if ((Object)(object)component != (Object)null) { component.Damage = damage; } } ((SpawnObjects)this).Spawn(); } } } namespace AALUND13Cards.Core.MonoBehaviours.CardsEffects { [RequireComponent(typeof(DamageSpawnedAttack), typeof(Explosion))] public class SetExplosionDamageOfTakenDamage : MonoBehaviour { public float ExplosionDamageMultiplier = 1f; private DamageSpawnedAttack damageSpawnedAttack; private Explosion explosion; private void Awake() { damageSpawnedAttack = ((Component)this).GetComponent(); explosion = ((Component)this).GetComponent(); } private void Start() { explosion.damage = ((Vector2)(ref damageSpawnedAttack.Damage)).magnitude * ExplosionDamageMultiplier; } } } namespace AALUND13Cards.Core.Handlers { 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> playerConstantDamages = new Dictionary>(); public Dictionary> PlayerConstantPrecentageDamages = new Dictionary>(); 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(); } 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(); } 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); } } internal void Reset() { playerConstantDamages.Clear(); PlayerConstantPrecentageDamages.Clear(); } 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 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> 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> 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 IOnDoDamageEventOverridable { DamageInfo OnDamage(DamageInfo info); } public interface IOnTakeDamageEvent { void OnTakeDamage(DamageInfo damage); } public interface IOnTakeDamageEventOverridable { DamageInfo OnTakeDamage(DamageInfo info); } public interface IOnTakeDamageOvertimeEvent { void OnTakeDamageOvertime(DamageInfo damage); } public interface IOnTakeDamageOvertimeEventOverridable { DamageInfo OnTakeDamageOvertime(DamageInfo info); } public class DamageEventHandler : MonoBehaviour { public enum DamageEventType { OnDoDamage, OnTakeDamage, OnTakeDamageOvertime } internal Dictionary> OnDoDamageEvents = new Dictionary>(); internal Dictionary> OnTakeDamageEvents = new Dictionary>(); internal Dictionary> OnTakeDamageOvertimeEvents = new Dictionary>(); internal Dictionary> OnDoDamageEventsOtherPlayer = new Dictionary>(); internal Dictionary> OnTakeDamageEventsOtherPlayer = new Dictionary>(); internal Dictionary> OnTakeDamageOvertimeEventsOtherPlayer = new Dictionary>(); internal Dictionary> OnDoDamageOverridableEvents = new Dictionary>(); internal Dictionary> OnTakeDamageOverridableEvents = new Dictionary>(); internal Dictionary> OnTakeDamageOvertimeOverridableEvents = new Dictionary>(); internal Dictionary> OnDoDamageEventsOverridableOtherPlayer = new Dictionary>(); internal Dictionary> OnTakeDamageEventsOverridableOtherPlayer = new Dictionary>(); internal Dictionary> OnTakeDamageOvertimeEventsOverridableOtherPlayer = new Dictionary>(); public static DamageEventHandler Instance; public void RegisterDamageEvent(object obj, Player player) { if (obj is IOnDoDamageEvent item) { if (!OnDoDamageEvents.ContainsKey(player)) { OnDoDamageEvents[player] = new List(); } OnDoDamageEvents[player].Add(item); } if (obj is IOnTakeDamageEvent item2) { if (!OnTakeDamageEvents.ContainsKey(player)) { OnTakeDamageEvents[player] = new List(); } OnTakeDamageEvents[player].Add(item2); } if (obj is IOnTakeDamageOvertimeEvent item3) { if (!OnTakeDamageOvertimeEvents.ContainsKey(player)) { OnTakeDamageOvertimeEvents[player] = new List(); } OnTakeDamageOvertimeEvents[player].Add(item3); } if (obj is IOnDoDamageEventOverridable item4) { if (!OnDoDamageOverridableEvents.ContainsKey(player)) { OnDoDamageOverridableEvents[player] = new List(); } OnDoDamageOverridableEvents[player].Add(item4); } if (obj is IOnTakeDamageEventOverridable item5) { if (!OnTakeDamageOverridableEvents.ContainsKey(player)) { OnTakeDamageOverridableEvents[player] = new List(); } OnTakeDamageOverridableEvents[player].Add(item5); } if (obj is IOnTakeDamageOvertimeEventOverridable item6) { if (!OnTakeDamageOvertimeOverridableEvents.ContainsKey(player)) { OnTakeDamageOvertimeOverridableEvents[player] = new List(); } OnTakeDamageOvertimeOverridableEvents[player].Add(item6); } } public void RegisterDamageEventForOtherPlayers(object obj, Player player) { if (obj is IOnDoDamageEvent item) { if (!OnDoDamageEventsOtherPlayer.ContainsKey(player)) { OnDoDamageEventsOtherPlayer[player] = new List(); } OnDoDamageEventsOtherPlayer[player].Add(item); } if (obj is IOnTakeDamageEvent item2) { if (!OnTakeDamageEventsOtherPlayer.ContainsKey(player)) { OnTakeDamageEventsOtherPlayer[player] = new List(); } OnTakeDamageEventsOtherPlayer[player].Add(item2); } if (obj is IOnTakeDamageOvertimeEvent item3) { if (!OnTakeDamageOvertimeEventsOtherPlayer.ContainsKey(player)) { OnTakeDamageOvertimeEventsOtherPlayer[player] = new List(); } OnTakeDamageOvertimeEventsOtherPlayer[player].Add(item3); } if (obj is IOnDoDamageEventOverridable item4) { if (!OnDoDamageEventsOverridableOtherPlayer.ContainsKey(player)) { OnDoDamageEventsOverridableOtherPlayer[player] = new List(); } OnDoDamageEventsOverridableOtherPlayer[player].Add(item4); } if (obj is IOnTakeDamageEventOverridable item5) { if (!OnTakeDamageEventsOverridableOtherPlayer.ContainsKey(player)) { OnTakeDamageEventsOverridableOtherPlayer[player] = new List(); } OnTakeDamageEventsOverridableOtherPlayer[player].Add(item5); } if (obj is IOnTakeDamageOvertimeEventOverridable item6) { if (!OnTakeDamageOvertimeEventsOverridableOtherPlayer.ContainsKey(player)) { OnTakeDamageOvertimeEventsOverridableOtherPlayer[player] = new List(); } OnTakeDamageOvertimeEventsOverridableOtherPlayer[player].Add(item6); } } 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); } if (obj is IOnDoDamageEventOverridable item7 && OnDoDamageOverridableEvents.ContainsKey(player)) { OnDoDamageOverridableEvents[player].Remove(item7); } if (obj is IOnTakeDamageEventOverridable item8 && OnTakeDamageOverridableEvents.ContainsKey(player)) { OnTakeDamageOverridableEvents[player].Remove(item8); } if (obj is IOnTakeDamageOvertimeEventOverridable item9 && OnTakeDamageOvertimeOverridableEvents.ContainsKey(player)) { OnTakeDamageOvertimeOverridableEvents[player].Remove(item9); } if (obj is IOnDoDamageEventOverridable item10 && OnDoDamageEventsOverridableOtherPlayer.ContainsKey(player)) { OnDoDamageEventsOverridableOtherPlayer[player].Remove(item10); } if (obj is IOnTakeDamageEventOverridable item11 && OnTakeDamageEventsOverridableOtherPlayer.ContainsKey(player)) { OnTakeDamageEventsOverridableOtherPlayer[player].Remove(item11); } if (obj is IOnTakeDamageOvertimeEventOverridable item12 && OnTakeDamageOvertimeEventsOverridableOtherPlayer.ContainsKey(player)) { OnTakeDamageOvertimeEventsOverridableOtherPlayer[player].Remove(item12); } } internal static DamageInfo 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 damageInfo = new DamageInfo(damage, isLethal, damagingPlayer, hurtPlayer); switch (eventType) { case DamageEventType.OnDoDamage: if (Instance.OnDoDamageEvents.ContainsKey(hurtPlayer)) { foreach (IOnDoDamageEvent item in Instance.OnDoDamageEvents[hurtPlayer]) { item.OnDamage(damageInfo); } } if (!Instance.OnDoDamageOverridableEvents.ContainsKey(hurtPlayer)) { break; } foreach (IOnDoDamageEventOverridable item2 in Instance.OnDoDamageOverridableEvents[hurtPlayer]) { damageInfo = item2.OnDamage(damageInfo); } break; case DamageEventType.OnTakeDamage: if (Instance.OnTakeDamageEvents.ContainsKey(hurtPlayer)) { foreach (IOnTakeDamageEvent item3 in Instance.OnTakeDamageEvents[hurtPlayer]) { item3.OnTakeDamage(damageInfo); } } if (!Instance.OnTakeDamageOverridableEvents.ContainsKey(hurtPlayer)) { break; } foreach (IOnTakeDamageEventOverridable item4 in Instance.OnTakeDamageOverridableEvents[hurtPlayer]) { damageInfo = item4.OnTakeDamage(damageInfo); } break; case DamageEventType.OnTakeDamageOvertime: if (Instance.OnTakeDamageOvertimeEvents.ContainsKey(hurtPlayer)) { foreach (IOnTakeDamageOvertimeEvent item5 in Instance.OnTakeDamageOvertimeEvents[hurtPlayer]) { item5.OnTakeDamageOvertime(damageInfo); } } if (!Instance.OnTakeDamageOvertimeOverridableEvents.ContainsKey(hurtPlayer)) { break; } foreach (IOnTakeDamageOvertimeEventOverridable item6 in Instance.OnTakeDamageOvertimeOverridableEvents[hurtPlayer]) { damageInfo = item6.OnTakeDamageOvertime(damageInfo); } break; } foreach (KeyValuePair> item7 in Instance.OnDoDamageEventsOtherPlayer) { if (!((Object)(object)item7.Key != (Object)(object)hurtPlayer)) { continue; } foreach (IOnDoDamageEvent item8 in item7.Value) { if (eventType == DamageEventType.OnDoDamage) { item8.OnDamage(damageInfo); } } } foreach (KeyValuePair> item9 in Instance.OnTakeDamageEventsOtherPlayer) { if (!((Object)(object)item9.Key != (Object)(object)hurtPlayer)) { continue; } foreach (IOnTakeDamageEvent item10 in item9.Value) { if (eventType == DamageEventType.OnTakeDamage) { item10.OnTakeDamage(damageInfo); } } } foreach (KeyValuePair> item11 in Instance.OnTakeDamageOvertimeEventsOtherPlayer) { if (!((Object)(object)item11.Key != (Object)(object)hurtPlayer)) { continue; } foreach (IOnTakeDamageOvertimeEvent item12 in item11.Value) { if (eventType == DamageEventType.OnTakeDamageOvertime) { item12.OnTakeDamageOvertime(damageInfo); } } } foreach (KeyValuePair> item13 in Instance.OnDoDamageEventsOverridableOtherPlayer) { if (!((Object)(object)item13.Key != (Object)(object)hurtPlayer)) { continue; } foreach (IOnDoDamageEventOverridable item14 in item13.Value) { if (eventType == DamageEventType.OnDoDamage) { damageInfo = item14.OnDamage(damageInfo); } } } foreach (KeyValuePair> item15 in Instance.OnTakeDamageEventsOverridableOtherPlayer) { if (!((Object)(object)item15.Key != (Object)(object)hurtPlayer)) { continue; } foreach (IOnTakeDamageEventOverridable item16 in item15.Value) { if (eventType == DamageEventType.OnTakeDamage) { damageInfo = item16.OnTakeDamage(damageInfo); } } } foreach (KeyValuePair> item17 in Instance.OnTakeDamageOvertimeEventsOverridableOtherPlayer) { if (!((Object)(object)item17.Key != (Object)(object)hurtPlayer)) { continue; } foreach (IOnTakeDamageOvertimeEventOverridable item18 in item17.Value) { if (eventType == DamageEventType.OnTakeDamageOvertime) { damageInfo = item18.OnTakeDamageOvertime(damageInfo); } } } return damageInfo; } private void Awake() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)this); } else { Instance = this; } } } public class DeathActionHandler : MonoBehaviour { public static DeathActionHandler Instance; internal Dictionary registeredReviveActions = new Dictionary(); internal Dictionary registeredTrueDeathActions = new Dictionary(); public DeathActionHandler() { Instance = this; } public void RegisterReviveAction(Player player, Action onRevive) { if (registeredReviveActions.TryGetValue(player, out var value)) { value = (Action)Delegate.Combine(value, onRevive); } else { registeredReviveActions.Add(player, onRevive); } } public void DeregisterReviveAction(Player player, Action onRevive) { if (registeredReviveActions.TryGetValue(player, out var value)) { value = (Action)Delegate.Remove(value, onRevive); } } public void RegisterTrueDeathAction(Player player, Action onTrueDeath) { if (registeredTrueDeathActions.TryGetValue(player, out var value)) { value = (Action)Delegate.Combine(value, onTrueDeath); } else { registeredTrueDeathActions.Add(player, onTrueDeath); } } public void DeregisterTrueDeathAction(Player player, Action onTrueDeath) { if (registeredTrueDeathActions.TryGetValue(player, out var value)) { value = (Action)Delegate.Remove(value, onTrueDeath); } } } 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(); 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(); }); } } public enum ExtraPickPhaseTrigger { TriggerInPlayerPickEnd, TriggerInPickEnd } public class ExtraPickHandler { public virtual int HandSize { get; set; } [Obsolete("Property Picks is deprecated. Use the number of times you call AddExtraPick instead to determine the number of picks.")] public int Picks { get; internal set; } public virtual bool PickConditions(Player player, CardInfo card) { return true; } public virtual void OnPickStart(Player player) { } public virtual void OnPickEnd(Player player, CardInfo card) { } } public static class ExtraCardPickHandler { internal static Dictionary>> extraPicks = new Dictionary>>(); public static ExtraPickHandler activePickHandler; public static Player currentPlayer; [Obsolete("Method AddExtraPick with ExtraPickPhaseTrigger parameter is deprecated. Use AddExtraPick without the parameter instead.")] public static void AddExtraPick(ExtraPickHandler extraPickHandler, Player player, int picks, ExtraPickPhaseTrigger pickPhaseTrigger = ExtraPickPhaseTrigger.TriggerInPlayerPickEnd) { AddExtraPick(extraPickHandler, player, picks); } [Obsolete("Method AddExtraPick with ExtraPickPhaseTrigger parameter is deprecated. Use AddExtraPick without the parameter instead.")] public static void AddExtraPick(Player player, int picks, ExtraPickPhaseTrigger pickPhaseTrigger = ExtraPickPhaseTrigger.TriggerInPlayerPickEnd) where T : ExtraPickHandler { AddExtraPick((ExtraPickHandler)Activator.CreateInstance(typeof(T)), player, picks); } public static void AddExtraPick(Player player, int picks) where T : ExtraPickHandler { AddExtraPick((ExtraPickHandler)Activator.CreateInstance(typeof(T)), player, picks); } public static ShuffleData RemoveExtraPick(Player player) where T : ExtraPickHandler { //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (!extraPicks.TryGetValue(player, out var value)) { throw new Exception($"Player '{player.playerID}' does not have any extra picks."); } if (!value.TryGetValue(typeof(T), out var value2)) { throw new Exception($"Player '{player.playerID}' does not have any extra picks of type '{typeof(T)}'."); } if (value2.Count <= 0) { throw new Exception($"Player '{player.playerID}' does not have any extra picks of type '{typeof(T)}'."); } ShuffleData result = value2[0]; value2.RemoveAt(0); return result; } public static ShuffleData RemoveExtraPick(ExtraPickHandler handler, Player player) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return RemoveExtraPick(handler.GetType(), player); } public static ShuffleData RemoveExtraPick(Type handlerType, Player player) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (!extraPicks.TryGetValue(player, out var value)) { throw new Exception($"Player '{player.playerID}' does not have any extra picks."); } if (!value.TryGetValue(handlerType, out var value2)) { throw new Exception($"Player '{player.playerID}' does not have any extra picks of type '{handlerType}'."); } if (value2.Count <= 0) { throw new Exception($"Player '{player.playerID}' does not have any extra picks of type '{handlerType}'."); } ShuffleData result = value2[0]; value2.RemoveAt(0); return result; } public static bool HasExtraPick(Player player) where T : ExtraPickHandler { if (extraPicks.TryGetValue(player, out var value) && value.TryGetValue(typeof(T), out var value2)) { return value2.Count > 0; } return false; } public static bool HasExtraPick(ExtraPickHandler handler, Player player) { if (extraPicks.TryGetValue(player, out var value) && value.TryGetValue(handler.GetType(), out var value2)) { return value2.Count > 0; } return false; } public static bool HasExtraPick(Player player, Type handlerType) { if (extraPicks.TryGetValue(player, out var value) && value.TryGetValue(handlerType, out var value2)) { return value2.Count > 0; } return false; } public static void AddExtraPick(ExtraPickHandler handler, Player player, int picks) { //IL_001d: 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_00b7: 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_0120: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < picks; i++) { ShuffleData val = default(ShuffleData); val.HandSize = handler.HandSize; val.Relative = false; val.Condition = (CardInfo info) => handler.PickConditions(player, info); val.pickStartCallback = delegate { //IL_0030: Unknown result type (might be due to invalid IL or missing references) handler.OnPickStart(player); if (HasExtraPick(handler, player)) { RemoveExtraPick(handler, player); } }; val.pickEndCallback = delegate { handler.OnPickEnd(player, PickManager.lastPickedCard); }; ShuffleData val2 = val; PickManager.QueueShuffleForPicker(player, val2); if (!extraPicks.TryGetValue(player, out var value)) { value = new Dictionary>(); extraPicks[player] = value; } if (!value.TryGetValue(handler.GetType(), out var value2)) { value2 = new List(); value[handler.GetType()] = value2; } value2.Add(val2); } } } } 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 data = new ConditionalWeakTable(); 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().damage * player.data.weaponHandler.gun.chargeDamageMultiplier; GunAmmo componentInChildren = ((Component)player.data.weaponHandler.gun).GetComponentInChildren(); 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()); 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(); 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()); 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 class AACustomCard : CustomUnityCard { public string RequireMod = ""; public bool IsCursed; public override void OnRegister(CardInfo cardInfo) { if (IsCursed) { CurseManager.instance.RegisterCurse(cardInfo); List list = new List(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(); 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(); 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 class CardResgester : MonoBehaviour { public static List AllModCards = new List(); public List Cards; private Dictionary ModCards = new Dictionary(); private void SetupCard(CustomCard customCard) { if (!((Object)(object)customCard == (Object)null)) { customCard.cardInfo = ((Component)customCard).GetComponent(); customCard.gun = ((Component)customCard).GetComponent(); customCard.cardStats = ((Component)customCard).GetComponent(); customCard.statModifiers = ((Component)customCard).GetComponent(); customCard.block = ExtensionMethods.GetOrAddComponent(((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(); AACustomCard customCard = card.GetComponent(); 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)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(); 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; } } }