Decompiled source of AfraiCards v1.2.1

AfraiCards.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AfraiCards.Cards;
using BepInEx;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using UnboundLib.Cards;
using UnityEngine;

[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("AfraiCards")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AfraiCards")]
[assembly: AssemblyTitle("AfraiCards")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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]
	[Microsoft.CodeAnalysis.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 AfraiCards
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Afrai.CardsV2", "AfraiCards", "1.0.0")]
	[BepInProcess("Rounds.exe")]
	public class AfraiCards : BaseUnityPlugin
	{
		private const string ModId = "com.Afrai.CardsV2";

		private const string ModName = "AfraiCards";

		public const string Version = "1.0.0";

		public const string ModInitials = "AFC";

		public static AfraiCards instance { get; private set; }

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("com.Afrai.CardsV2");
			val.PatchAll();
		}

		private void Start()
		{
			instance = this;
			CustomCard.BuildCard<Heavy>();
			CustomCard.BuildCard<GarlockTheDestroyer>();
			CustomCard.BuildCard<Shaked>();
			CustomCard.BuildCard<BeyondEcho>();
			CustomCard.BuildCard<Storm>();
		}
	}
	internal class Assets
	{
		private static readonly AssetBundle Bundle = AssetUtils.LoadAssetBundleFromResources("afraicards", typeof(AfraiCards).Assembly);

		public static GameObject GarlockTheDestroyerArt = Bundle.LoadAsset<GameObject>("C_GarlockTheDestroyer");

		public static GameObject ShakedArt = Bundle.LoadAsset<GameObject>("C_Shaked");

		public static GameObject HeavyArt = Bundle.LoadAsset<GameObject>("C_Heavy");

		public static GameObject BeyondEchoArt = Bundle.LoadAsset<GameObject>("C_BeyondEcho");

		public static GameObject StormArt = Bundle.LoadAsset<GameObject>("C_Storm");
	}
}
namespace AfraiCards.Cards
{
	internal class BeyondEcho : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			Debug.Log((object)("[AFC][Card] " + ((CustomCard)this).GetTitle() + " has been setup."));
			cardInfo.allowMultiple = false;
			block.additionalBlocks = 100;
			block.cdAdd = 5f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
			typeof(Block).GetField("timeBetweenBlocks", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(player.data.block, (float)typeof(Block).GetField("timeBetweenBlocks", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(player.data.block) + -0.18f);
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
		}

		protected override string GetTitle()
		{
			return "Beyond Echo";
		}

		protected override string GetDescription()
		{
			return "Echos block dozens of times";
		}

		protected override GameObject GetCardArt()
		{
			return Assets.BeyondEchoArt;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)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
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Block Echo",
					amount = "+100",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Block Cooldown",
					amount = "Longer Cooldown",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)2;
		}

		public override string GetModName()
		{
			return "AFC";
		}
	}
	internal class GarlockTheDestroyer : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			Debug.Log((object)("[AFC][Card] " + ((CustomCard)this).GetTitle() + " has been setup."));
			cardInfo.allowMultiple = false;
			statModifiers.sizeMultiplier = 2.5f;
			statModifiers.health = 15f;
			statModifiers.movementSpeed = 0.35f;
			gun.reloadTimeAdd = 2f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
		}

		protected override string GetTitle()
		{
			return "Garlock The Destroyer";
		}

		protected override string GetDescription()
		{
			return "Jabba the hutt";
		}

		protected override GameObject GetCardArt()
		{
			return Assets.GarlockTheDestroyerArt;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)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
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Fat",
					amount = "Massive Health",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Slow",
					amount = "Hard to move",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)4;
		}

		public override string GetModName()
		{
			return "AFC";
		}
	}
	internal class Heavy : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			//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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)("[AFC][Card] " + ((CustomCard)this).GetTitle() + " has been setup."));
			statModifiers.sizeMultiplier = 1.5f;
			gun.numberOfProjectiles = 5;
			gun.ammo = 500;
			cardInfo.allowMultiple = false;
			gun.reloadTime = 0f;
			gun.dontAllowAutoFire = false;
			gun.projectileSpeed = 10f;
			gun.projectileSize = 0.5f;
			gun.attackSpeed = 0.05f;
			gun.projectileColor = Color.LerpUnclamped(Color.black, Color.yellow, 1.5f);
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
			CharacterStatModifiers statModifiers = base.statModifiers;
			statModifiers.health *= 2.5f;
			gun.spread += 0.35f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
		}

		protected override string GetTitle()
		{
			return "HEAVY";
		}

		protected override string GetDescription()
		{
			return "I am heavy weapons guy.";
		}

		protected override GameObject GetCardArt()
		{
			return Assets.HeavyArt;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)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 = "HEAVY",
					amount = "Overpowered",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)0;
		}

		public override string GetModName()
		{
			return "AFC";
		}
	}
	internal class Shaked : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			Debug.Log((object)("[AFC][Card] " + ((CustomCard)this).GetTitle() + " has been setup."));
			cardInfo.allowMultiple = false;
			statModifiers.movementSpeed = 5.5f;
			statModifiers.numberOfJumps = 6;
			statModifiers.jump = 2f;
			gun.reloadTime = 0.05f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
			gun.attackSpeed /= 5f;
			gun.projectileSpeed *= 4f;
			characterStats.sizeMultiplier /= 2f;
			CharacterStatModifiers statModifiers = base.statModifiers;
			statModifiers.health /= 2f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
		}

		protected override string GetTitle()
		{
			return "Shaked Dayan";
		}

		protected override string GetDescription()
		{
			return "Sheldon Cooper";
		}

		protected override GameObject GetCardArt()
		{
			return Assets.ShakedArt;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)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
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Speedy Mcqueen",
					amount = "Racing Mode + Fast Reload",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Garden Gnome",
					amount = "Smal + Less Health",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)7;
		}

		public override string GetModName()
		{
			return "AFC";
		}
	}
	internal class Storm : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)("[AFC][Card] " + ((CustomCard)this).GetTitle() + " has been setup."));
			gun.reflects = 10;
			gun.waveMovement = true;
			gun.attackSpeed = 0.1f;
			gun.reloadTimeAdd = 5f;
			gun.ammo = 250;
			gun.numberOfProjectiles = 250;
			gun.projectileSpeed = 3f;
			gun.multiplySpread = 1.35f;
			gun.spread = 0.14f;
			gun.projectileColor = Color.blue;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been added to player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
			gun.damage /= 5f;
			gun.projectileSize /= 7f;
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Debug.Log((object)string.Format("[{0}][Card] {1} has been removed from player {2}.", "AFC", ((CustomCard)this).GetTitle(), player.playerID));
		}

		protected override string GetTitle()
		{
			return "Storm";
		}

		protected override string GetDescription()
		{
			return "Bullet Storm";
		}

		protected override GameObject GetCardArt()
		{
			return Assets.StormArt;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)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
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Bullets",
					amount = "Way More",
					simepleAmount = (SimpleAmount)3
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Damage",
					amount = "Way Less",
					simepleAmount = (SimpleAmount)7
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)2;
		}

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