using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using Microsoft.CodeAnalysis; using Sonigon; using SoundImplementation; using UnboundLib; using UnboundLib.Cards; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("MADGEIOSCustomCards")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MADGEIOSCustomCards")] [assembly: AssemblyTitle("MADGEIOSCustomCards")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace MadgeiosDemonicCardsPack { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.madgeios.customcards", "MADGEIOS Custom Cards", "1.2.4")] [BepInProcess("Rounds.exe")] public class MyMod : BaseUnityPlugin { private const string ModId = "com.madgeios.customcards"; private const string ModName = "MADGEIOS Custom Cards"; private const string Version = "1.2.4"; private void Awake() { } private void Start() { CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); CustomCard.BuildCard(); } } public static class CardArtLoader { private static readonly Dictionary loadedArts = new Dictionary(); public static GameObject Load(string cardName) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) if (loadedArts.TryGetValue(cardName, out GameObject value)) { if ((Object)(object)value != (Object)null) { return value; } loadedArts.Remove(cardName); } string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string text = Path.Combine(directoryName, "Assets", cardName + ".png"); string text2 = Path.Combine(directoryName, cardName + ".png"); string text3 = null; if (File.Exists(text)) { text3 = text; } else if (File.Exists(text2)) { text3 = text2; } if (text3 == null) { Debug.LogError("[MADGEIOS] Card art not found: " + cardName); return null; } byte[] array = File.ReadAllBytes(text3); Texture2D val = new Texture2D(2, 2); if (!ImageConversion.LoadImage(val, array)) { Debug.LogError("[MADGEIOS] Failed to load card art: " + text3); Object.Destroy((Object)(object)val); return null; } Sprite sprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); GameObject val2 = new GameObject(cardName + "CardArt"); Image val3 = val2.AddComponent(); val3.sprite = sprite; val3.preserveAspect = false; RectTransform component = val2.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; component.anchoredPosition = Vector2.zero; ((Transform)component).localRotation = Quaternion.identity; ((Transform)component).localScale = Vector3.one; Object.DontDestroyOnLoad((Object)(object)val2); loadedArts[cardName] = val2; return val2; } } public class PlummetCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block) { block.cdAdd = 0.25f; gun.damage = 1.25f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { PlummetBlockModifier orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.player = player; orAddComponent.block = block; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { PlummetBlockModifier component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Plummet"; } protected override string GetDescription() { return "Blocking forces all bullets downwards."; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)0; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0035: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_005f: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "DMG", amount = "+25%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Block cooldown", amount = "+0.5s", simepleAmount = (SimpleAmount)0 } }; } public override void Callback() { } protected override GameObject GetCardArt() { return CardArtLoader.Load("Plummet"); } } public class PlummetBlockModifier : MonoBehaviour { public Player player; public Block block; private void Start() { if ((Object)(object)block != (Object)null) { Block obj = block; obj.BlockAction = (Action)Delegate.Combine(obj.BlockAction, new Action(OnBlock)); } } private void OnBlock(BlockTriggerType trigger) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)SoundPlayerStatic.Instance != (Object)null) { SoundPlayerStatic.Instance.PlayPlayerBallAppear(); } GameObject[] array = GameObject.FindGameObjectsWithTag("Bullet"); GameObject[] array2 = array; foreach (GameObject val in array2) { MoveTransform component = val.GetComponent(); if ((Object)(object)component == (Object)null) { continue; } SpriteRenderer[] componentsInChildren = val.GetComponentsInChildren(); SpriteRenderer[] array3 = componentsInChildren; foreach (SpriteRenderer val2 in array3) { val2.color = Color.red; } Renderer[] componentsInChildren2 = val.GetComponentsInChildren(); Renderer[] array4 = componentsInChildren2; foreach (Renderer val3 in array4) { if ((Object)(object)val3.material != (Object)null) { val3.material.color = Color.red; } } TrailRenderer[] componentsInChildren3 = val.GetComponentsInChildren(); TrailRenderer[] array5 = componentsInChildren3; foreach (TrailRenderer val4 in array5) { val4.startColor = Color.red; val4.endColor = Color.red; } component.velocity = Vector2.op_Implicit(Vector2.down * ((Vector3)(ref component.velocity)).magnitude); } } private void OnDestroy() { if ((Object)(object)block != (Object)null) { Block obj = block; obj.BlockAction = (Action)Delegate.Remove(obj.BlockAction, new Action(OnBlock)); } } } public class SacrificeCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { statModifiers.health = 0.85f; statModifiers.movementSpeed = 1.3f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Sacrifice"; } protected override string GetDescription() { return "Blood for speed."; } protected override Rarity GetRarity() { return (Rarity)0; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)4; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0035: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_005f: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = false, stat = "HP", amount = "-15%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Movement speed", amount = "+30%", simepleAmount = (SimpleAmount)0 } }; } public override void Callback() { } protected override GameObject GetCardArt() { return CardArtLoader.Load("Sacrifice"); } } public class RecoveryCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { statModifiers.movementSpeed = 0.7f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ((Component)player).gameObject.AddComponent(); } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { RecoveryModifier[] components = ((Component)player).gameObject.GetComponents(); if (components.Length != 0) { RecoveryModifier recoveryModifier = components[^1]; if ((Object)(object)recoveryModifier != (Object)null) { Object.Destroy((Object)(object)recoveryModifier); } } } protected override string GetTitle() { return "Recovery"; } protected override string GetDescription() { return "Slowly regain health whilst under 75% max HP."; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)6; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0035: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_005f: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = false, stat = "Movement speed", amount = "-30%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = true, stat = "Regeneration", amount = "4% of Max HP/s", simepleAmount = (SimpleAmount)0 } }; } public override void Callback() { } protected override GameObject GetCardArt() { return CardArtLoader.Load("Recovery"); } } public class RecoveryModifier : MonoBehaviour { private HealthHandler health; private CharacterData data; private void Start() { health = ((Component)this).GetComponent(); data = ((Component)this).GetComponent(); } private void Update() { if (!((Object)(object)health == (Object)null) && !((Object)(object)data == (Object)null) && !(data.health / data.maxHealth >= 0.75f)) { health.Heal(data.maxHealth * 0.04f * TimeHandler.deltaTime); } } } public class ArcAmmoCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { gun.attackSpeed = 1.2f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ArcAmmoModifier orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.owner = player; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { ArcAmmoModifier component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Arc Ammo"; } protected override string GetDescription() { return "Your bullets connect with electric arcs that deal minor damage and slow enemies."; } protected override Rarity GetRarity() { return (Rarity)2; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)3; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = false, stat = "ATKSPD", amount = "-20%", simepleAmount = (SimpleAmount)0 } }; } public override void Callback() { } protected override GameObject GetCardArt() { return CardArtLoader.Load("ArcAmmo"); } } public class ArcAmmoModifier : MonoBehaviour { public Player owner; private float maxArcDistance = 15f; private float arcDamage = 5f; private float slowAmount = 0.5f; private List connections = new List(); private SoundEvent GetEmpowerSound() { Empower[] array = Resources.FindObjectsOfTypeAll(); if (array.Length != 0) { return array[0].soundEmpowerSpawn; } return null; } private void Update() { UpdateBullets(); UpdateConnections(); } private void UpdateBullets() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) GameObject[] array = GameObject.FindGameObjectsWithTag("Bullet"); List list = new List(); GameObject[] array2 = array; foreach (GameObject val in array2) { ProjectileHit component = val.GetComponent(); if (!((Object)(object)component == (Object)null) && (Object)(object)component.ownPlayer == (Object)(object)owner) { list.Add(val); } } for (int j = 0; j < list.Count - 1; j++) { GameObject val2 = list[j]; GameObject val3 = list[j + 1]; float num = Vector2.Distance(Vector2.op_Implicit(val2.transform.position), Vector2.op_Implicit(val3.transform.position)); if (num <= maxArcDistance && FindConnection(val2, val3) == null) { SoundEvent empowerSound = GetEmpowerSound(); if ((Object)(object)empowerSound != (Object)null) { SoundManager.Instance.PlayAtPosition(empowerSound, SoundManager.Instance.GetTransform(), ((Component)owner).transform); } connections.Add(new ArcConnection(val2, val3, arcDamage, slowAmount, owner)); } } } private void UpdateConnections() { List list = new List(); foreach (ArcConnection connection in connections) { if (!connection.Update()) { list.Add(connection); } } foreach (ArcConnection item in list) { item.Destroy(); connections.Remove(item); } } private ArcConnection FindConnection(GameObject a, GameObject b) { foreach (ArcConnection connection in connections) { if (connection.Matches(a, b)) { return connection; } } return null; } private void OnDestroy() { foreach (ArcConnection connection in connections) { connection.Destroy(); } } } public class ArcConnection { private GameObject bullet1; private GameObject bullet2; private LineRenderer line; private LineRenderer glow; private float damage; private float slowAmount; private Player owner; private HashSet hitPlayers = new HashSet(); public ArcConnection(GameObject a, GameObject b, float damageAmount, float slow, Player playerOwner) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) bullet1 = a; bullet2 = b; damage = damageAmount; slowAmount = slow; owner = playerOwner; GameObject val = new GameObject("Arc Ammo Lightning"); line = val.AddComponent(); line.positionCount = 2; line.widthMultiplier = 0.05f; ((Renderer)line).material = new Material(Shader.Find("Sprites/Default")); line.startColor = new Color(0.1f, 0.9f, 1f, 1f); line.endColor = new Color(0.1f, 0.9f, 1f, 1f); GameObject val2 = new GameObject("Arc Ammo Glow"); glow = val2.AddComponent(); glow.positionCount = 2; glow.widthMultiplier = 0.12f; ((Renderer)glow).material = new Material(Shader.Find("Sprites/Default")); glow.startColor = new Color(0.1f, 0.9f, 1f, 0.25f); glow.endColor = new Color(0.1f, 0.9f, 1f, 0.25f); } public bool Update() { //IL_0038: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bullet1 == (Object)null || (Object)(object)bullet2 == (Object)null) { return false; } line.SetPosition(0, bullet1.transform.position); line.SetPosition(1, bullet2.transform.position); glow.SetPosition(0, bullet1.transform.position); glow.SetPosition(1, bullet2.transform.position); CheckDamage(); return true; } private void CheckDamage() { //IL_000c: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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) //IL_0145: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit((bullet1.transform.position + bullet2.transform.position) / 2f); float num = Vector2.Distance(Vector2.op_Implicit(bullet1.transform.position), Vector2.op_Implicit(bullet2.transform.position)); Collider2D[] array = Physics2D.OverlapCapsuleAll(val, new Vector2(num, 0.3f), (CapsuleDirection2D)1, 0f); Collider2D[] array2 = array; foreach (Collider2D val2 in array2) { if ((Object)(object)((Component)val2).GetComponentInParent() != (Object)null) { continue; } HealthHandler componentInParent = ((Component)val2).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null) && !((Object)(object)componentInParent == (Object)(object)((Component)owner).GetComponent()) && !hitPlayers.Contains(componentInParent)) { Vector3 val3 = ((Component)componentInParent).transform.position - ((Component)owner).transform.position; Vector2 val4 = Vector2.op_Implicit(((Vector3)(ref val3)).normalized); ((Damagable)componentInParent).CallTakeDamage(val4 * damage, Vector2.op_Implicit(((Component)componentInParent).transform.position), ((Component)owner).gameObject, owner, true); CharacterStatModifiers component = ((Component)componentInParent).GetComponent(); if ((Object)(object)component != (Object)null) { component.RPCA_AddSlow(slowAmount, false); } hitPlayers.Add(componentInParent); } } } public bool Matches(GameObject a, GameObject b) { return ((Object)(object)bullet1 == (Object)(object)a && (Object)(object)bullet2 == (Object)(object)b) || ((Object)(object)bullet1 == (Object)(object)b && (Object)(object)bullet2 == (Object)(object)a); } public void Destroy() { if ((Object)(object)line != (Object)null) { Object.Destroy((Object)(object)((Component)line).gameObject); } if ((Object)(object)glow != (Object)null) { Object.Destroy((Object)(object)((Component)glow).gameObject); } } } public class AfterburnCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { gun.projectileSpeed = 1.4f; gun.ammo = -1; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AfterburnModifier orAddComponent = ExtensionMethods.GetOrAddComponent(((Component)player).gameObject, false); orAddComponent.owner = player; } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { AfterburnModifier component = ((Component)player).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } protected override string GetTitle() { return "Afterburn"; } protected override string GetDescription() { return "Bullets leaving burning trails that do 30% of your bullets damage."; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)1; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0035: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_005f: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "Bullet speed", amount = "+40%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "AMMO", amount = "-1", simepleAmount = (SimpleAmount)0 } }; } public override void Callback() { } protected override GameObject GetCardArt() { return CardArtLoader.Load("Afterburn"); } } public class AfterburnModifier : MonoBehaviour { public Player owner; private List trails = new List(); private void Update() { UpdateBullets(); UpdateTrails(); } private void UpdateBullets() { GameObject[] array = GameObject.FindGameObjectsWithTag("Bullet"); GameObject[] array2 = array; foreach (GameObject val in array2) { ProjectileHit component = val.GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component.ownPlayer != (Object)(object)owner)) { AfterburnTrail component2 = val.GetComponent(); if ((Object)(object)component2 == (Object)null) { component2 = val.AddComponent(); component2.Setup(owner, component.damage); trails.Add(component2); } } } } private void UpdateTrails() { List list = new List(); foreach (AfterburnTrail trail in trails) { if (!trail.UpdateTrail()) { list.Add(trail); } } foreach (AfterburnTrail item in list) { trails.Remove(item); } } private void OnDestroy() { foreach (AfterburnTrail trail in trails) { trail.Destroy(); } } } public class AfterburnTrail : MonoBehaviour { private LineRenderer line; private List points = new List(); private float lifeTime = 1.2f; private float age = 0f; private GameObject trailObject; private bool bulletAlive = true; private Player owner; private float damage; private HashSet hitPlayers = new HashSet(); public void Setup(Player playerOwner, float bulletDamage) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) owner = playerOwner; damage = bulletDamage * 0.3f; trailObject = new GameObject("Afterburn Trail"); line = trailObject.AddComponent(); line.positionCount = 0; line.widthMultiplier = 0.08f; ((Renderer)line).material = new Material(Shader.Find("Sprites/Default")); line.startColor = new Color(1f, 0.3f, 0.05f, 1f); line.endColor = new Color(1f, 0.8f, 0.1f, 1f); } public bool UpdateTrail() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; CheckDamage(); if (bulletAlive) { points.Add(((Component)this).transform.position); if (points.Count > 50) { points.RemoveAt(0); } } if ((Object)(object)line != (Object)null) { line.positionCount = points.Count; for (int i = 0; i < points.Count; i++) { line.SetPosition(i, points[i]); } float num = Mathf.Clamp01(1f - age / lifeTime); line.startColor = new Color(1f, 0.3f, 0.05f, num); line.endColor = new Color(1f, 0.8f, 0.1f, num); } if (age >= lifeTime) { Destroy(); return false; } return true; } private void CheckDamage() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)owner == (Object)null) { return; } foreach (Vector3 point in points) { Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(point), 0.15f); Collider2D[] array2 = array; foreach (Collider2D val in array2) { HealthHandler componentInParent = ((Component)val).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null) && !((Object)(object)componentInParent == (Object)(object)((Component)owner).GetComponent()) && !hitPlayers.Contains(componentInParent)) { Vector3 val2 = ((Component)componentInParent).transform.position - ((Component)owner).transform.position; Vector2 val3 = Vector2.op_Implicit(((Vector3)(ref val2)).normalized); ((Damagable)componentInParent).CallTakeDamage(val3 * damage, Vector2.op_Implicit(((Component)componentInParent).transform.position), ((Component)owner).gameObject, owner, true); hitPlayers.Add(componentInParent); } } } } public void Destroy() { if ((Object)(object)trailObject != (Object)null) { Object.Destroy((Object)(object)trailObject); } } private void OnDestroy() { bulletAlive = false; } } public class BuoyantCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { statModifiers.gravity = 0.4f; statModifiers.jump = 1.2f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Buoyant"; } protected override string GetDescription() { return "You become lighter and less affected by gravity."; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[1] { new CardInfoStat { positive = true, stat = "Jump height", amount = "+20%", simepleAmount = (SimpleAmount)0 } }; } public override void Callback() { } protected override GameObject GetCardArt() { return CardArtLoader.Load("Buoyant"); } } public class ColossalCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { statModifiers.health = 2.5f; gun.attackSpeed = 1.5f; gun.reloadTimeAdd = 0.5f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Colossal"; } protected override string GetDescription() { return ""; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)2; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0035: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_005f: Expected O, but got Unknown //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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[3] { new CardInfoStat { positive = true, stat = "HP", amount = "+150%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "ATKSPD", amount = "+50%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Reload time", amount = "+0.5s", simepleAmount = (SimpleAmount)0 } }; } public override void Callback() { } protected override GameObject GetCardArt() { return CardArtLoader.Load("Colossal"); } } public class SlugsCard : CustomCard { public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers) { gun.damage = 1.6f; gun.projectileSpeed = 0.6f; } public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) { } protected override string GetTitle() { return "Slugs"; } protected override string GetDescription() { return "Shoot stronger but heavier bullets."; } protected override Rarity GetRarity() { return (Rarity)1; } protected override CardThemeColorType GetTheme() { return (CardThemeColorType)1; } protected override CardInfoStat[] GetStats() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0035: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_005f: Expected O, but got Unknown return (CardInfoStat[])(object)new CardInfoStat[2] { new CardInfoStat { positive = true, stat = "DMG", amount = "+60%", simepleAmount = (SimpleAmount)0 }, new CardInfoStat { positive = false, stat = "Bullet speed", amount = "-40%", simepleAmount = (SimpleAmount)0 } }; } public override void Callback() { } protected override GameObject GetCardArt() { return CardArtLoader.Load("Slugs"); } } }