Decompiled source of CarlCards v1.0.1

CarlCardsMod.dll

Decompiled a day ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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: AssemblyTitle("CarlCardsMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CarlCardsMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0229abfe-7551-4680-a1c9-913c8ca23fe5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.SRCocoa.CarlCardsModwithPhon", "CarlCards", "1.0.0")]
[BepInProcess("Rounds.exe")]
public static class AssetUtils
{
	public static Sprite LoadSpriteFromFile(string filePath)
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Expected O, but got Unknown
		//IL_0059: 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)
		if (!File.Exists(filePath))
		{
			Debug.LogError("File " + filePath + " not found.");
			return null;
		}
		byte[] array = File.ReadAllBytes(filePath);
		Texture2D val = new Texture2D(2, 2);
		ImageConversion.LoadImage(val, array);
		return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
	}
}
public class MetalPipe : CustomCard
{
	protected override string GetTitle()
	{
		return "Metal Pipe";
	}

	protected override string GetDescription()
	{
		return "hmm a metal pipe, oops i dropp- *explosion sfx*";
	}

	protected override GameObject GetCardArt()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		string filePath = Path.Combine(Paths.PluginPath, "CarlCardsModwithPhon/images/power_boost_card.png");
		Sprite val = AssetUtils.LoadSpriteFromFile(filePath);
		if ((Object)(object)val != (Object)null)
		{
			GameObject val2 = new GameObject("CardArt");
			SpriteRenderer val3 = val2.AddComponent<SpriteRenderer>();
			val3.sprite = val;
			return val2;
		}
		return null;
	}

	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 = false,
				stat = "Gravity",
				amount = "+300%",
				simepleAmount = (SimpleAmount)3
			},
			new CardInfoStat
			{
				positive = true,
				stat = "Damage",
				amount = "Some",
				simepleAmount = (SimpleAmount)2
			}
		};
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
		gravity.gravityForce *= 4f;
		gun.damage *= 1.5f;
	}

	public override void OnRemoveCard()
	{
	}

	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)3;
	}
}