Decompiled source of MetonMadnessMod v1.0.1

MeltonMadnessMod.dll

Decompiled a week ago
using System.Diagnostics;
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("MeltonMadnessMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MeltonMadnessMod")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4d36d10e-7566-408f-a939-d4ea90a9a7a2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
public abstract class BaseCustomCard : CustomCard
{
	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)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)3;
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

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

	protected abstract override string GetTitle();

	protected abstract override string GetDescription();

	public abstract override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers);

	protected abstract override CardInfoStat[] GetStats();

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
		Debug.Log((object)$"[{((CustomCard)this).GetModName()}][Card] {((CustomCard)this).GetTitle()} has been added to player {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)$"[{((CustomCard)this).GetModName()}][Card] {((CustomCard)this).GetTitle()} has been removed from player {player.playerID}.");
	}
}
public class HoneyPie : BaseCustomCard
{
	protected override string GetTitle()
	{
		return "Honey Pie";
	}

	protected override GameObject GetCardArt()
	{
		return null;
	}

	protected override string GetDescription()
	{
		return "While it was filling, was it really worth it?";
	}

	public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		statModifiers.sizeMultiplier = 1.4f;
		cardInfo.rarity = (Rarity)2;
		CardCategory meltonMadnessCategory = MetonMadnessMod.GetMeltonMadnessCategory();
		if ((Object)(object)meltonMadnessCategory == (Object)null)
		{
			Debug.LogError((object)("[" + ((CustomCard)this).GetModName() + "][Card] MeltonMadness category is null for " + ((CustomCard)this).GetTitle()));
		}
		else
		{
			Debug.Log((object)("[" + ((CustomCard)this).GetModName() + "][Card] Assigning category " + ((Object)meltonMadnessCategory).name + " to " + ((CustomCard)this).GetTitle()));
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { meltonMadnessCategory };
		}
		gun.projectileSize = 2f;
		gun.gravity = 2f;
		gun.knockback = 2.45f;
		statModifiers.gravity = 2f;
		Debug.Log((object)("[" + ((CustomCard)this).GetModName() + "][Card] " + ((CustomCard)this).GetTitle() + " has been setup."));
	}

	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
		//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_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Expected O, but got Unknown
		return (CardInfoStat[])(object)new CardInfoStat[4]
		{
			new CardInfoStat
			{
				positive = true,
				stat = "Knockback",
				amount = "Yummy",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Big",
				amount = "More",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Gravity",
				amount = "Some more",
				simepleAmount = (SimpleAmount)0
			},
			new CardInfoStat
			{
				positive = false,
				stat = "Fat Bullets",
				amount = "More",
				simepleAmount = (SimpleAmount)0
			}
		};
	}

	public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
	{
		Debug.Log((object)$"[{((CustomCard)this).GetModName()}][Card] {((CustomCard)this).GetTitle()} has been added to player {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)$"[{((CustomCard)this).GetModName()}][Card] {((CustomCard)this).GetTitle()} has been removed from player {player.playerID}.");
	}
}
[BepInPlugin("com.chris.metonmadnessmod", "MeltonMadness", "1.0.1")]
[BepInDependency("com.willis.rounds.unbound", "3.2.13")]
public class MetonMadnessMod : BaseUnityPlugin
{
	private static CardCategory meltonMadnessCategory;

	private void Awake()
	{
		Debug.Log((object)"[MetonMadnessMod] Plugin loaded, starting initialization...");
		InitializeMod();
	}

	private void InitializeMod()
	{
		Debug.Log((object)"[MetonMadnessMod] Initializing mod...");
		if ((Object)(object)meltonMadnessCategory == (Object)null)
		{
			Debug.Log((object)"[MetonMadnessMod] Creating MeltonMadness category...");
			meltonMadnessCategory = ScriptableObject.CreateInstance<CardCategory>();
			((Object)meltonMadnessCategory).name = "MeltonMadness";
			Debug.Log((object)("[MetonMadnessMod] Custom category created with name: " + ((Object)meltonMadnessCategory).name));
		}
		Debug.Log((object)"[MetonMadnessMod] Registering HoneyPie card...");
		CustomCard.BuildCard<HoneyPie>();
		Debug.Log((object)"[MetonMadnessMod] HoneyPie card registered successfully.");
	}

	public static CardCategory GetMeltonMadnessCategory()
	{
		return meltonMadnessCategory;
	}
}