Decompiled source of CharmUnlocker v2.0.0

CharmUnlocker.dll

Decompiled 5 days ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("CharmUnlocker")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CharmUnlocker")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("57a0bf5e-3dfe-418c-abc9-dfc7ae6863c7")]
[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")]
namespace CharmUnlocker;

[BepInPlugin("com.xxx.charmunlocker", "CharmUnlocker", "1.0.0")]
public class CharmUnlockerPlugin : BaseUnityPlugin
{
	public const string GUID = "com.xxx.charmunlocker";

	public const string PluginName = "CharmUnlocker";

	public const string Version = "1.0.0";

	internal static ManualLogSource Log;

	private Harmony _harmony;

	private void Awake()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Expected O, but got Unknown
		Log = ((BaseUnityPlugin)this).Logger;
		Log.LogInfo((object)"CharmUnlocker v1.0.0 is loading...");
		_harmony = new Harmony("com.xxx.charmunlocker");
		_harmony.PatchAll();
		Log.LogInfo((object)"CharmUnlocker loaded successfully! You can now equip 50 charms.");
		Log.LogInfo((object)"Leaderboard uploads have been disabled.");
	}

	private void OnDestroy()
	{
		Harmony harmony = _harmony;
		if (harmony != null)
		{
			harmony.UnpatchSelf();
		}
	}
}
[HarmonyPatch(typeof(GameplayData))]
public static class GameplayDataPatches
{
	[HarmonyPatch("MaxEquippablePowerupsGet")]
	[HarmonyPostfix]
	public static void MaxEquippablePowerupsGet_Postfix(ref int __result)
	{
		__result = 50;
	}

	[HarmonyPatch("CanUploadToLeaderboardsGet")]
	[HarmonyPostfix]
	public static void CanUploadToLeaderboardsGet_Postfix(ref bool __result)
	{
		__result = false;
		CharmUnlockerPlugin.Log.LogDebug((object)"Leaderboard upload blocked.");
	}
}