using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Extensions;
using HarmonyLib;
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("AllInMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1")]
[assembly: AssemblyProduct("AllInMod")]
[assembly: AssemblyTitle("AllInMod")]
[assembly: AssemblyVersion("1.0.1.0")]
namespace AllInMod;
[BepInPlugin("com.yourname.slotsallin", "All-In Mod", "1.0.1")]
public class Plugin : BaseUnityPlugin
{
private void Awake()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
new Harmony("com.hugsterf.allinmod").PatchAll();
Debug.Log((object)"[SlotsAllIn] Mod loaded!");
}
}
[HarmonyPatch(typeof(GameBase))]
public static class GameBasePatch
{
[HarmonyPatch("get_MaxBet")]
[HarmonyPrefix]
public static bool OverrideMaxBet(GameBase __instance, ref long __result)
{
try
{
if (__instance.isGoldenChipApplied)
{
Debug.Log((object)"[SlotsAllIn] Golden chip active — using original MaxBet");
return true;
}
MoneyManager instance = NetworkSingleton<MoneyManager>.Instance;
if ((Object)(object)instance == (Object)null)
{
Debug.LogWarning((object)"[SlotsAllIn] MoneyManager is null");
return true;
}
long balance = instance.balance;
long minBet = __instance.MinBet;
__result = ((balance < minBet) ? minBet : balance);
Debug.Log((object)("[SlotsAllIn] MaxBet = " + __result + " (Balance=" + balance + ")"));
return false;
}
catch (Exception ex)
{
Debug.LogError((object)("[SlotsAllIn] Error: " + ex.Message));
return true;
}
}
}