Decompiled source of UniRandomCards v0.0.1

UniRandomCards.dll

Decompiled 5 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using ModdingUtils.Utils;
using ModsPlus;
using RarityLib.Utils;
using UnboundLib.Cards;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("UniRandomCards")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("UniRandomCards")]
[assembly: AssemblyTitle("UniRandomCards")]
[assembly: AssemblyVersion("1.0.0.0")]
public static class CardRegistry
{
	private static Dictionary<Type, CardInfo> storedCardInfo = new Dictionary<Type, CardInfo>();

	public static void RegisterCard<T>(bool hidden = false) where T : CustomCard
	{
		CustomCard.BuildCard<T>((Action<CardInfo>)delegate(CardInfo c)
		{
			StoreCard<T>(c);
			if (hidden)
			{
				Cards.instance.AddHiddenCard(c);
			}
		});
	}

	private static void StoreCard<T>(CardInfo card) where T : CustomCard
	{
		storedCardInfo.Add(typeof(T), card);
	}

	public static CardInfo GetCard<T>() where T : CustomCard
	{
		if (storedCardInfo.TryGetValue(typeof(T), out var value))
		{
			return value;
		}
		return null;
	}

	public static CardInfo GetCard(Type T)
	{
		if (storedCardInfo.TryGetValue(T, out var value))
		{
			return value;
		}
		return null;
	}
}
public class GlassCannon : SimpleCard
{
	public override CardDetails Details
	{
		get
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_0068: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			//IL_0088: 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_0094: 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)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected O, but got Unknown
			CardDetails val = new CardDetails();
			val.Title = "Glass Cannon";
			val.Description = "Powerful but fragile";
			val.ModName = "UniRandomCards";
			val.Rarity = RarityUtils.GetRarity("Exotic");
			val.Theme = (CardThemeColorType)1;
			val.Art = DeckSmithUtil.Instance.GetArtFromUrl("https://static.tvtropes.org/pmwiki/pub/images/glass_cannon_by_swarleyswazenoskie-d604r4t_6338.png");
			val.Stats = (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+4900%",
					simepleAmount = (SimpleAmount)4
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "-90%",
					simepleAmount = (SimpleAmount)7
				}
			};
			return val;
		}
	}

	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
	{
		Dictionary<string, Action<float>> dictionary = new Dictionary<string, Action<float>>();
		dictionary.Add("damage", delegate(float val)
		{
			gun.damage = val;
		});
		dictionary.Add("health", delegate(float val)
		{
			statModifiers.health = val;
		});
		dictionary.Add("reload", delegate(float val)
		{
			gun.reloadTime = val;
		});
		dictionary.Add("ammo", delegate(float val)
		{
			gun.ammo = (int)val;
		});
		dictionary.Add("projectiles", delegate(float val)
		{
			gun.numberOfProjectiles = Mathf.Max(1, (int)val);
		});
		dictionary.Add("bursts", delegate(float val)
		{
			gun.bursts = (int)val;
		});
		dictionary.Add("timeBetweenBullets", delegate(float val)
		{
			gun.timeBetweenBullets = val;
		});
		dictionary.Add("attackSpeed", delegate(float val)
		{
			gun.attackSpeed = val;
		});
		dictionary.Add("bounces", delegate(float val)
		{
			gun.reflects = (int)val;
		});
		dictionary.Add("bulletSpeed", delegate(float val)
		{
			gun.projectileSpeed = val;
		});
		dictionary["damage"](50f);
		dictionary["health"](0.1f);
	}
}
public class Minigun : SimpleCard
{
	public override CardDetails Details
	{
		get
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_0068: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			//IL_0088: 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_0094: 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)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected O, but got Unknown
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: 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_00de: Expected O, but got Unknown
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Expected O, but got Unknown
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: 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_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Expected O, but got Unknown
			CardDetails val = new CardDetails();
			val.Title = "Minigun";
			val.Description = "...but the bullets are really fucking weak";
			val.ModName = "UniRandomCards";
			val.Rarity = RarityUtils.GetRarity("Epic");
			val.Theme = (CardThemeColorType)0;
			val.Art = DeckSmithUtil.Instance.GetArtFromUrl("https://upload.wikimedia.org/wikipedia/commons/9/97/XM214_Minigun.jpg");
			val.Stats = (CardInfoStat[])(object)new CardInfoStat[5]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "-90%",
					simepleAmount = (SimpleAmount)7
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Bullet Speed",
					amount = "+50%",
					simepleAmount = (SimpleAmount)1
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Ammunition",
					amount = "+100",
					simepleAmount = (SimpleAmount)4
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Time Between Bullets",
					amount = "-1 seconds",
					simepleAmount = (SimpleAmount)7
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Bursts",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				}
			};
			return val;
		}
	}

	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
	{
		Dictionary<string, Action<float>> dictionary = new Dictionary<string, Action<float>>();
		dictionary.Add("damage", delegate(float val)
		{
			gun.damage = val;
		});
		dictionary.Add("health", delegate(float val)
		{
			statModifiers.health = val;
		});
		dictionary.Add("reload", delegate(float val)
		{
			gun.reloadTime = val;
		});
		dictionary.Add("ammo", delegate(float val)
		{
			gun.ammo = (int)val;
		});
		dictionary.Add("projectiles", delegate(float val)
		{
			gun.numberOfProjectiles = Mathf.Max(1, (int)val);
		});
		dictionary.Add("bursts", delegate(float val)
		{
			gun.bursts = (int)val;
		});
		dictionary.Add("timeBetweenBullets", delegate(float val)
		{
			gun.timeBetweenBullets = val;
		});
		dictionary.Add("attackSpeed", delegate(float val)
		{
			gun.attackSpeed = val;
		});
		dictionary.Add("bounces", delegate(float val)
		{
			gun.reflects = (int)val;
		});
		dictionary.Add("bulletSpeed", delegate(float val)
		{
			gun.projectileSpeed = val;
		});
		dictionary["damage"](0.1f);
		dictionary["bulletSpeed"](1.5f);
		dictionary["ammo"](100f);
		dictionary["timeBetweenBullets"](-1f);
		dictionary["bursts"](1f);
	}
}
public class Nothing : SimpleCard
{
	public override CardDetails Details
	{
		get
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_0068: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			CardDetails val = new CardDetails();
			val.Title = "Nothing";
			val.Description = "Literally nothing";
			val.ModName = "UniRandomCards";
			val.Rarity = RarityUtils.GetRarity("Common");
			val.Theme = (CardThemeColorType)3;
			val.Art = DeckSmithUtil.Instance.GetArtFromUrl("https://d1nhio0ox7pgb.cloudfront.net/_img/o_collection_png/green_dark_grey/512x512/plain/symbol_questionmark.png");
			val.Stats = (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "+0%",
					simepleAmount = (SimpleAmount)0
				}
			};
			return val;
		}
	}

	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
	{
		Dictionary<string, Action<float>> dictionary = new Dictionary<string, Action<float>>();
		dictionary.Add("damage", delegate(float val)
		{
			gun.damage = val;
		});
		dictionary.Add("health", delegate(float val)
		{
			statModifiers.health = val;
		});
		dictionary.Add("reload", delegate(float val)
		{
			gun.reloadTime = val;
		});
		dictionary.Add("ammo", delegate(float val)
		{
			gun.ammo = (int)val;
		});
		dictionary.Add("projectiles", delegate(float val)
		{
			gun.numberOfProjectiles = Mathf.Max(1, (int)val);
		});
		dictionary.Add("bursts", delegate(float val)
		{
			gun.bursts = (int)val;
		});
		dictionary.Add("timeBetweenBullets", delegate(float val)
		{
			gun.timeBetweenBullets = val;
		});
		dictionary.Add("attackSpeed", delegate(float val)
		{
			gun.attackSpeed = val;
		});
		dictionary.Add("bounces", delegate(float val)
		{
			gun.reflects = (int)val;
		});
		dictionary.Add("bulletSpeed", delegate(float val)
		{
			gun.projectileSpeed = val;
		});
		dictionary["health"](1f);
	}
}
public class Smoking : SimpleCard
{
	public override CardDetails Details
	{
		get
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_0068: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			CardDetails val = new CardDetails();
			val.Title = "Smoking";
			val.Description = "So cool, you'll start smoking!";
			val.ModName = "UniRandomCards";
			val.Rarity = RarityUtils.GetRarity("Rare");
			val.Theme = (CardThemeColorType)0;
			val.Art = DeckSmithUtil.Instance.GetArtFromUrl("https://p.turbosquid.com/ts-thumb/4s/a5xhW9/BGrVhp7c/_01/jpg/1335447577/1920x1080/turn_fit_q99/ed3fbe40eb35885eed3a3ccc9af2f9ae63ef4a9b/_01-1.jpg");
			val.Stats = (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "-80%",
					simepleAmount = (SimpleAmount)4
				}
			};
			return val;
		}
	}

	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
	{
		Dictionary<string, Action<float>> dictionary = new Dictionary<string, Action<float>>();
		dictionary.Add("damage", delegate(float val)
		{
			gun.damage = val;
		});
		dictionary.Add("health", delegate(float val)
		{
			statModifiers.health = val;
		});
		dictionary.Add("reload", delegate(float val)
		{
			gun.reloadTime = val;
		});
		dictionary.Add("ammo", delegate(float val)
		{
			gun.ammo = (int)val;
		});
		dictionary.Add("projectiles", delegate(float val)
		{
			gun.numberOfProjectiles = Mathf.Max(1, (int)val);
		});
		dictionary.Add("bursts", delegate(float val)
		{
			gun.bursts = (int)val;
		});
		dictionary.Add("timeBetweenBullets", delegate(float val)
		{
			gun.timeBetweenBullets = val;
		});
		dictionary.Add("attackSpeed", delegate(float val)
		{
			gun.attackSpeed = val;
		});
		dictionary.Add("bounces", delegate(float val)
		{
			gun.reflects = (int)val;
		});
		dictionary.Add("bulletSpeed", delegate(float val)
		{
			gun.projectileSpeed = val;
		});
		dictionary["health"](0.2f);
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.example.rounds.mod", "UniRandomCards", "0.0.1")]
[BepInProcess("Rounds.exe")]
public class UniRandomCardsPlugin : BaseUnityPlugin
{
	private const string ModId = "com.example.rounds.mod";

	private const string ModName = "UniRandomCards";

	private const string ModVersion = "0.0.1";

	private const string CompatabilityModName = "UniRandomCards";

	private void Awake()
	{
		CardRegistry.RegisterCard<Nothing>(hidden: false);
		CardRegistry.RegisterCard<Smoking>(hidden: false);
		CardRegistry.RegisterCard<GlassCannon>(hidden: false);
		CardRegistry.RegisterCard<Minigun>(hidden: false);
	}

	private void Start()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("com.example.rounds.mod").PatchAll();
	}
}