Decompiled source of GamblingMod v2.1.2

Mods/GamblingMod.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using GamblingMod;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppPhoton.Pun;
using Il2CppRUMBLE.Audio;
using Il2CppRUMBLE.Combat.ShiftStones;
using Il2CppRUMBLE.Economy.Interactables;
using Il2CppRUMBLE.Environment.Howard;
using Il2CppRUMBLE.Interactions.InteractionBase;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.Players;
using Il2CppRUMBLE.Players.Subsystems;
using Il2CppRUMBLE.Pools;
using Il2CppRUMBLE.Poses;
using Il2CppRUMBLE.UI;
using Il2CppRUMBLE.Utilities;
using Il2CppSystem;
using Il2CppTMPro;
using MelonLoader;
using RumbleModUI;
using RumbleModdingAPI;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Main), "GamblingMod", "2.1.2", "UlvakSkillz", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 195, 0, 255)]
[assembly: MelonAuthorColor(255, 195, 0, 255)]
[assembly: VerifyLoaderVersion(0, 6, 6, true)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("GamblingMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+0ef635e815b7dbad78a83ff2d556c50340fe4b44")]
[assembly: AssemblyProduct("GamblingMod")]
[assembly: AssemblyTitle("GamblingMod")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace GamblingMod;

public class BlackJack : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <>c__DisplayClass26_0
	{
		public bool continuePressed;

		internal void <GameLoop>b__0()
		{
			continuePressed = true;
		}
	}

	[CompilerGenerated]
	private sealed class <DealerDraw>d__59 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public BlackJack <>4__this;

		private object <playDrawAnimationCoroutine>5__1;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <DealerDraw>d__59(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<playDrawAnimationCoroutine>5__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>4__this.dealerHand.Add(<>4__this.DrawCard());
				Log($"Dealer Card {<>4__this.dealerHand.Count}: " + <>4__this.tableInstance.CardString[<>4__this.dealerHand[<>4__this.dealerHand.Count - 1]], (bool)((ModSetting)Main.debugging).SavedValue);
				<playDrawAnimationCoroutine>5__1 = <>4__this.PlayDrawCardAnimation(<>4__this.dealerHand[<>4__this.dealerHand.Count - 1], <>4__this.cardSpots.transform.GetChild(1).GetChild(<>4__this.dealerHand.Count - 1), <>4__this.tableInstance.dealerDeck.transform.GetChild(0).GetChild(0).position, Quaternion.Euler(-180f, 0f, 0f));
				<>2__current = <playDrawAnimationCoroutine>5__1;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <DealersTurn>d__58 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public BlackJack <>4__this;

		private object <revealDealerCardCoroutine>5__1;

		private bool <hasAce>5__2;

		private bool <aceIs11>5__3;

		private int <dealerTotal>5__4;

		private bool <hasSoft17>5__5;

		private object <dealerDrawCorooutine>5__6;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <DealersTurn>d__58(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<revealDealerCardCoroutine>5__1 = null;
			<dealerDrawCorooutine>5__6 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				Log("DealersTurn Started", (bool)((ModSetting)Main.debugging).SavedValue);
				<revealDealerCardCoroutine>5__1 = MelonCoroutines.Start(<>4__this.RevealDealerCard());
				<>2__current = <revealDealerCardCoroutine>5__1;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<hasAce>5__2 = false;
				<aceIs11>5__3 = false;
				<dealerTotal>5__4 = <>4__this.GetDealerHandTotal();
				<hasSoft17>5__5 = (<dealerTotal>5__4 == 17) & <hasAce>5__2 & <aceIs11>5__3;
				break;
			case 2:
				<>1__state = -1;
				<dealerTotal>5__4 = <>4__this.GetDealerHandTotal();
				<hasSoft17>5__5 = (<dealerTotal>5__4 == 17) & <hasAce>5__2 & <aceIs11>5__3;
				<>2__current = (object)new WaitForSeconds(0.25f);
				<>1__state = 3;
				return true;
			case 3:
				<>1__state = -1;
				<dealerDrawCorooutine>5__6 = null;
				break;
			}
			if ((<dealerTotal>5__4 < 17) | <hasSoft17>5__5)
			{
				<dealerDrawCorooutine>5__6 = MelonCoroutines.Start(<>4__this.DealerDraw());
				<>2__current = <dealerDrawCorooutine>5__6;
				<>1__state = 2;
				return true;
			}
			Log("DealersTurn Completed", (bool)((ModSetting)Main.debugging).SavedValue);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <DrawSplit>d__57 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public int thisHand;

		public bool recreateOriginal;

		public BlackJack <>4__this;

		private bool <drawFirstSpot>5__1;

		private object <playDrawAnimationCoroutine>5__2;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <DrawSplit>d__57(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<playDrawAnimationCoroutine>5__2 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<drawFirstSpot>5__1 = false;
				if (<>4__this.hand[thisHand][0] == -1)
				{
					<>4__this.hand[thisHand][0] = <>4__this.DrawCard();
					<drawFirstSpot>5__1 = true;
				}
				else
				{
					<>4__this.PlayDrawCardAnimation(<>4__this.hand[thisHand][0], <>4__this.cardSpots.transform.GetChild(0).GetChild(0), <>4__this.cardSpots.transform.GetChild(0).GetChild(0).position, Quaternion.Euler(0f, 0f, 0f), playRotate: false);
				}
				if (<>4__this.hand[thisHand][1] == -1)
				{
					<>4__this.hand[thisHand][1] = <>4__this.DrawCard();
					<drawFirstSpot>5__1 = false;
				}
				else
				{
					<>4__this.PlayDrawCardAnimation(<>4__this.hand[thisHand][1], <>4__this.cardSpots.transform.GetChild(0).GetChild(1), <>4__this.cardSpots.transform.GetChild(0).GetChild(1).position, Quaternion.Euler(0f, 0f, 0f), playRotate: false);
				}
				<playDrawAnimationCoroutine>5__2 = <>4__this.PlayDrawCardAnimation(<>4__this.hand[thisHand][(!<drawFirstSpot>5__1) ? 1 : 0], <>4__this.cardSpots.transform.GetChild(0).GetChild((!<drawFirstSpot>5__1) ? 1 : 0), <>4__this.tableInstance.dealerDeck.transform.GetChild(0).GetChild(0).position, Quaternion.Euler(-180f, 0f, 0f));
				<>2__current = <playDrawAnimationCoroutine>5__2;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <GameLoop>d__26 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public BlackJack <>4__this;

		private GameObject <youBrokeAsFuck>5__1;

		private TextMeshPro <endGameTextTMP>5__2;

		private <>c__DisplayClass26_0 <>8__3;

		private List<int> <playerHandTotals>5__4;

		private int <dealerHandTotal>5__5;

		private string <coinLine>5__6;

		private GameObject <endGameText>5__7;

		private TextMeshPro <endGameTextTMP>5__8;

		private GameObject <continueButton>5__9;

		private int <i>5__10;

		private List<GameObject> <handCards>5__11;

		private List<GameObject> <dealerCards>5__12;

		private object <endGameCoroutine0>5__13;

		private object <endGameCoroutine1>5__14;

		private string <cardString0>5__15;

		private string <cardString1>5__16;

		private List<int>.Enumerator <>s__17;

		private int <card>5__18;

		private List<int>.Enumerator <>s__19;

		private int <card>5__20;

		private List<GameObject>.Enumerator <>s__21;

		private GameObject <handCard>5__22;

		private List<GameObject>.Enumerator <>s__23;

		private GameObject <dealerCard>5__24;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <GameLoop>d__26(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<youBrokeAsFuck>5__1 = null;
			<endGameTextTMP>5__2 = null;
			<>8__3 = null;
			<playerHandTotals>5__4 = null;
			<coinLine>5__6 = null;
			<endGameText>5__7 = null;
			<endGameTextTMP>5__8 = null;
			<continueButton>5__9 = null;
			<handCards>5__11 = null;
			<dealerCards>5__12 = null;
			<endGameCoroutine0>5__13 = null;
			<endGameCoroutine1>5__14 = null;
			<cardString0>5__15 = null;
			<cardString1>5__16 = null;
			<>s__17 = default(List<int>.Enumerator);
			<>s__19 = default(List<int>.Enumerator);
			<>s__21 = default(List<GameObject>.Enumerator);
			<handCard>5__22 = null;
			<>s__23 = default(List<GameObject>.Enumerator);
			<dealerCard>5__24 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Expected O, but got Unknown
			//IL_0a07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a11: Expected O, but got Unknown
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Expected O, but got Unknown
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Expected O, but got Unknown
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Expected O, but got Unknown
			//IL_0c2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cfc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3b: Expected O, but got Unknown
			//IL_0671: Unknown result type (might be due to invalid IL or missing references)
			//IL_067b: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				Log("GameLoop Running", (bool)((ModSetting)Main.debugging).SavedValue);
				<>4__this.gameLoopRunning = true;
				goto IL_0dab;
			case 1:
				<>1__state = -1;
				goto IL_0111;
			case 2:
				<>1__state = -1;
				<>4__this.gameLoopRunning = false;
				break;
			case 3:
				<>1__state = -1;
				<>4__this.tableInstance.ClearActiveObjects();
				<>2__current = (object)new WaitForSeconds(1.5f);
				<>1__state = 4;
				return true;
			case 4:
				<>1__state = -1;
				if (<>4__this.userQuits)
				{
					<>4__this.gameLoopRunning = false;
				}
				if (<>4__this.betAccepted)
				{
					<>8__3 = new <>c__DisplayClass26_0();
					Log("Player Bet Accepted: " + <>4__this.betAmount);
					Main.Payout(-<>4__this.betAmount, 1f, <>4__this.tableInstance);
					<>4__this.betHeldAmount = <>4__this.betAmount;
					<>4__this.coinsGained = 0;
					<>2__current = MelonCoroutines.Start(<>4__this.PlayHands());
					<>1__state = 5;
					return true;
				}
				goto IL_0d99;
			case 5:
				<>1__state = -1;
				<>2__current = MelonCoroutines.Start(<>4__this.DealersTurn());
				<>1__state = 6;
				return true;
			case 6:
				<>1__state = -1;
				<playerHandTotals>5__4 = <>4__this.GetPlayerHandTotal();
				<dealerHandTotal>5__5 = <>4__this.GetDealerHandTotal();
				<i>5__10 = <playerHandTotals>5__4.Count - 1;
				goto IL_0b2f;
			case 7:
				<>1__state = -1;
				<endGameCoroutine0>5__13 = null;
				<endGameCoroutine1>5__14 = null;
				<cardString0>5__15 = "";
				<>s__17 = <>4__this.hand[<i>5__10].GetEnumerator();
				try
				{
					while (<>s__17.MoveNext())
					{
						<card>5__18 = <>s__17.Current;
						<cardString0>5__15 = <cardString0>5__15 + <>4__this.tableInstance.CardString[<card>5__18] + " ";
					}
				}
				finally
				{
					((IDisposable)<>s__17).Dispose();
				}
				<>s__17 = default(List<int>.Enumerator);
				<cardString1>5__16 = "";
				<>s__19 = <>4__this.dealerHand.GetEnumerator();
				try
				{
					while (<>s__19.MoveNext())
					{
						<card>5__20 = <>s__19.Current;
						<cardString1>5__16 = <cardString1>5__16 + <>4__this.tableInstance.CardString[<card>5__20] + " ";
					}
				}
				finally
				{
					((IDisposable)<>s__19).Dispose();
				}
				<>s__19 = default(List<int>.Enumerator);
				Log($"Checking Hand {<i>5__10}: Player {<playerHandTotals>5__4[<i>5__10]} ( {<cardString0>5__15}) vs Dealer {<dealerHandTotal>5__5} ( {<cardString1>5__16})");
				<>2__current = (object)new WaitForSeconds(0.5f);
				<>1__state = 8;
				return true;
			case 8:
				<>1__state = -1;
				if (<>4__this.has21Immediately)
				{
					Log($"Player Got 21 Immediately! Gained {<>4__this.betAmount * 2} Coins");
					<>4__this.coinsGained += Main.Payout(<>4__this.betAmount, 2f, <>4__this.tableInstance);
					<endGameCoroutine0>5__13 = MelonCoroutines.Start(<>4__this.PlayPlayerWin(<handCards>5__11, <dealerCards>5__12));
				}
				else if (<playerHandTotals>5__4[<i>5__10] > 21)
				{
					Log($"Player Bust, Lost {<>4__this.betAmount} Coins");
					<>4__this.betHeldAmount -= <>4__this.betAmount;
					<>4__this.coinsGained -= <>4__this.betAmount;
					<endGameCoroutine0>5__13 = MelonCoroutines.Start(<>4__this.PlayPlayerBust(<handCards>5__11));
				}
				else if (<playerHandTotals>5__4[<i>5__10] > <dealerHandTotal>5__5 || <dealerHandTotal>5__5 > 21)
				{
					Log($"Player Beat Dealer! Gained {(int)((float)<>4__this.betAmount * 1.5f)} Coins");
					<>4__this.coinsGained += Main.Payout(<>4__this.betAmount, 1.5f, <>4__this.tableInstance);
					<endGameCoroutine0>5__13 = MelonCoroutines.Start(<>4__this.PlayPlayerWin(<handCards>5__11, <dealerCards>5__12));
				}
				else
				{
					Log($"Player Didn't Beat Dealer, Lost {<>4__this.betAmount} Coins");
					<>4__this.betHeldAmount -= <>4__this.betAmount;
					<>4__this.coinsGained -= <>4__this.betAmount;
					<endGameCoroutine0>5__13 = MelonCoroutines.Start(<>4__this.PlayDealerWin(<handCards>5__11, <dealerCards>5__12));
				}
				if (<dealerHandTotal>5__5 > 21)
				{
					<endGameCoroutine1>5__14 = MelonCoroutines.Start(<>4__this.PlayDealerBust(<dealerCards>5__12));
				}
				<>2__current = <endGameCoroutine0>5__13;
				<>1__state = 9;
				return true;
			case 9:
				<>1__state = -1;
				<>2__current = <endGameCoroutine1>5__14;
				<>1__state = 10;
				return true;
			case 10:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(0.25f);
				<>1__state = 11;
				return true;
			case 11:
				<>1__state = -1;
				<>s__21 = <handCards>5__11.GetEnumerator();
				try
				{
					while (<>s__21.MoveNext())
					{
						<handCard>5__22 = <>s__21.Current;
						Object.Destroy((Object)(object)<handCard>5__22);
						<handCard>5__22 = null;
					}
				}
				finally
				{
					((IDisposable)<>s__21).Dispose();
				}
				<>s__21 = default(List<GameObject>.Enumerator);
				<>s__23 = <dealerCards>5__12.GetEnumerator();
				try
				{
					while (<>s__23.MoveNext())
					{
						<dealerCard>5__24 = <>s__23.Current;
						Object.Destroy((Object)(object)<dealerCard>5__24);
						<dealerCard>5__24 = null;
					}
				}
				finally
				{
					((IDisposable)<>s__23).Dispose();
				}
				<>s__23 = default(List<GameObject>.Enumerator);
				<handCards>5__11 = null;
				<dealerCards>5__12 = null;
				<endGameCoroutine0>5__13 = null;
				<endGameCoroutine1>5__14 = null;
				<cardString0>5__15 = null;
				<cardString1>5__16 = null;
				<i>5__10--;
				goto IL_0b2f;
			case 12:
				{
					<>1__state = -1;
					goto IL_0d4d;
				}
				IL_0111:
				<>4__this.betAmount = 1;
				if (!<>4__this.tableInstance.freePlay && Main.GetPlayerCoinCount() < <>4__this.betAmount)
				{
					<youBrokeAsFuck>5__1 = <>4__this.tableInstance.SpawnText(((Component)<>4__this.activeGamePartsTransform).transform, "Too Few Coins. Try Free Play or" + Environment.NewLine + "Complete More Poses to Earn Coins", new Vector3(0f, <>4__this.tableInstance.TABLEHEIGHT - 0.025f, 0.65f), Quaternion.Euler(90f, 180f, 0f), new Vector3(1f, 1f, 1f));
					((Object)<youBrokeAsFuck>5__1).name = "You Broke As Fuck";
					<endGameTextTMP>5__2 = <youBrokeAsFuck>5__1.GetComponent<TextMeshPro>();
					((TMP_Text)<endGameTextTMP>5__2).alignment = (TextAlignmentOptions)514;
					((TMP_Text)<endGameTextTMP>5__2).enableWordWrapping = false;
					<>4__this.continueShuffling = false;
					Log("Not Enough Coins, Exiting BlackJack", (bool)((ModSetting)Main.debugging).SavedValue);
					<>2__current = (object)new WaitForSeconds(1.5f);
					<>1__state = 2;
					return true;
				}
				<>4__this.tableInstance.ClearActiveObjects();
				<>2__current = MelonCoroutines.Start(<>4__this.RunBetMenu());
				<>1__state = 3;
				return true;
				IL_0d99:
				<>4__this.tableInstance.ClearActiveObjects();
				goto IL_0dab;
				IL_0d4d:
				if (!<>8__3.continuePressed && <>4__this.gameLoopRunning)
				{
					<>2__current = (object)new WaitForFixedUpdate();
					<>1__state = 12;
					return true;
				}
				<>8__3 = null;
				<playerHandTotals>5__4 = null;
				<coinLine>5__6 = null;
				<endGameText>5__7 = null;
				<endGameTextTMP>5__8 = null;
				<continueButton>5__9 = null;
				goto IL_0d99;
				IL_0b2f:
				if (<i>5__10 >= 0 && <>4__this.gameLoopRunning)
				{
					<>4__this.ClearVisualCardsFromAHand(isPlayer: true);
					<>4__this.ClearVisualCardsFromAHand(isPlayer: false);
					<handCards>5__11 = <>4__this.SpawnHandCards(<i>5__10);
					<dealerCards>5__12 = <>4__this.SpawnDealerCards();
					<>2__current = (object)new WaitForSeconds(0.25f);
					<>1__state = 7;
					return true;
				}
				Main.Payout(<>4__this.betHeldAmount, 1f, <>4__this.tableInstance);
				<>8__3.continuePressed = false;
				<coinLine>5__6 = ((<>4__this.coinsGained < 0) ? $"Coins Lost: {-<>4__this.coinsGained}" : $"Coins Gained: {<>4__this.coinsGained}");
				<endGameText>5__7 = <>4__this.tableInstance.SpawnText(((Component)<>4__this.activeGamePartsTransform).transform, <coinLine>5__6, new Vector3(0f, <>4__this.tableInstance.TABLEHEIGHT - 0.025f, 0.5f), Quaternion.Euler(90f, 180f, 0f), new Vector3(1f, 1f, 1f));
				((Object)<endGameText>5__7).name = "End Game Text";
				<endGameTextTMP>5__8 = <endGameText>5__7.GetComponent<TextMeshPro>();
				((TMP_Text)<endGameTextTMP>5__8).alignment = (TextAlignmentOptions)514;
				((TMP_Text)<endGameTextTMP>5__8).enableWordWrapping = false;
				<continueButton>5__9 = <>4__this.tableInstance.LoadMenuButton("Continue", new Vector3(0f, <>4__this.tableInstance.TABLEHEIGHT - 0.025f, 0.96f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f), delegate
				{
					<>8__3.continuePressed = true;
				});
				((Object)<continueButton>5__9).name = "Continue";
				goto IL_0d4d;
				IL_0dab:
				if (!<>4__this.gameLoopRunning)
				{
					break;
				}
				if (<>4__this.deck.Count <= 26 * (int)((ModSetting)Main.deckCount).SavedValue)
				{
					<>4__this.RandomizeDeck(continueShuffling: false);
					<>2__current = (object)new WaitForSeconds(1f);
					<>1__state = 1;
					return true;
				}
				goto IL_0111;
			}
			Log("GameLoop Completed", (bool)((ModSetting)Main.debugging).SavedValue);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <PlayCardBustCoroutine>d__32 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public GameObject card;

		public BlackJack <>4__this;

		private Vector3 <startingScale>5__1;

		private Vector3 <scalePerTick>5__2;

		private int <i>5__3;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <PlayCardBustCoroutine>d__32(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				Log("PlayCardBustCoroutine Started", (bool)((ModSetting)Main.debugging).SavedValue);
				<startingScale>5__1 = card.transform.localScale;
				<scalePerTick>5__2 = <startingScale>5__1 / 50f;
				<i>5__3 = 0;
				break;
			case 1:
				<>1__state = -1;
				<i>5__3++;
				break;
			}
			if (<i>5__3 < 50)
			{
				Transform transform = card.transform;
				transform.localScale -= <scalePerTick>5__2;
				<>2__current = (object)new WaitForFixedUpdate();
				<>1__state = 1;
				return true;
			}
			Log("PlayCardBustCoroutine Completed", (bool)((ModSetting)Main.debugging).SavedValue);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <PlayCardReactCoroutine>d__29 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public GameObject card;

		public bool win;

		public bool isPlayer;

		public BlackJack <>4__this;

		private Vector3 <startingPostion>5__1;

		private Vector3 <movePerTick>5__2;

		private int <i>5__3;

		private int <i>5__4;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <PlayCardReactCoroutine>d__29(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: 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_0050: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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_00bb: Expected O, but got Unknown
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Expected O, but got Unknown
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<startingPostion>5__1 = card.transform.localPosition;
				<movePerTick>5__2 = (isPlayer ? Vector3.back : Vector3.forward) / 50f * (win ? 0.5f : (-0.25f));
				<i>5__3 = 0;
				goto IL_00dc;
			case 1:
				<>1__state = -1;
				<i>5__3++;
				goto IL_00dc;
			case 2:
				{
					<>1__state = -1;
					<i>5__4++;
					break;
				}
				IL_00dc:
				if (<i>5__3 < 25)
				{
					Transform transform = card.transform;
					transform.localPosition += <movePerTick>5__2;
					<>2__current = (object)new WaitForFixedUpdate();
					<>1__state = 1;
					return true;
				}
				<i>5__4 = 0;
				break;
			}
			if (<i>5__4 < 25)
			{
				Transform transform2 = card.transform;
				transform2.localPosition -= <movePerTick>5__2;
				<>2__current = (object)new WaitForFixedUpdate();
				<>1__state = 2;
				return true;
			}
			card.transform.localPosition = <startingPostion>5__1;
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <PlayDealerBust>d__31 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public List<GameObject> handCards;

		public BlackJack <>4__this;

		private List<object> <cardsReacting>5__1;

		private int <i>5__2;

		private List<object>.Enumerator <>s__3;

		private object <card>5__4;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <PlayDealerBust>d__31(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || num == 1)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
			<cardsReacting>5__1 = null;
			<>s__3 = default(List<object>.Enumerator);
			<card>5__4 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					Log("PlayDealerBust Started", (bool)((ModSetting)Main.debugging).SavedValue);
					<cardsReacting>5__1 = new List<object>();
					<i>5__2 = 0;
					while (<i>5__2 < handCards.Count)
					{
						<cardsReacting>5__1.Add(MelonCoroutines.Start(<>4__this.PlayCardBustCoroutine(handCards[<i>5__2])));
						<i>5__2++;
					}
					<>s__3 = <cardsReacting>5__1.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<card>5__4 = null;
					break;
				}
				if (<>s__3.MoveNext())
				{
					<card>5__4 = <>s__3.Current;
					<>2__current = <card>5__4;
					<>1__state = 1;
					return true;
				}
				<>m__Finally1();
				<>s__3 = default(List<object>.Enumerator);
				Log("PlayDealerBust Completed", (bool)((ModSetting)Main.debugging).SavedValue);
				return false;
			}
			catch
			{
				//try-fault
				((IDisposable)this).Dispose();
				throw;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			((IDisposable)<>s__3).Dispose();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <PlayDealerWin>d__33 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public List<GameObject> handCards;

		public List<GameObject> dealerCards;

		public BlackJack <>4__this;

		private List<object> <cardsReacting>5__1;

		private int <i>5__2;

		private int <i>5__3;

		private List<object>.Enumerator <>s__4;

		private object <card>5__5;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <PlayDealerWin>d__33(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || num == 1)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
			<cardsReacting>5__1 = null;
			<>s__4 = default(List<object>.Enumerator);
			<card>5__5 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					Log("PlayDealerWin Started", (bool)((ModSetting)Main.debugging).SavedValue);
					<cardsReacting>5__1 = new List<object>();
					<i>5__2 = 0;
					while (<i>5__2 < handCards.Count)
					{
						<cardsReacting>5__1.Add(<>4__this.PlayCardReact(handCards[<i>5__2], win: false, isPlayer: true));
						<i>5__2++;
					}
					<i>5__3 = 0;
					while (<i>5__3 < dealerCards.Count)
					{
						<cardsReacting>5__1.Add(<>4__this.PlayCardReact(dealerCards[<i>5__3], win: true, isPlayer: false));
						<i>5__3++;
					}
					<>s__4 = <cardsReacting>5__1.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<card>5__5 = null;
					break;
				}
				if (<>s__4.MoveNext())
				{
					<card>5__5 = <>s__4.Current;
					<>2__current = <card>5__5;
					<>1__state = 1;
					return true;
				}
				<>m__Finally1();
				<>s__4 = default(List<object>.Enumerator);
				Log("PlayDealerWin Completed", (bool)((ModSetting)Main.debugging).SavedValue);
				return false;
			}
			catch
			{
				//try-fault
				((IDisposable)this).Dispose();
				throw;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			((IDisposable)<>s__4).Dispose();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <PlayDrawAnimation>d__43 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public GameObject card;

		public int ticks;

		public bool playRotate;

		public BlackJack <>4__this;

		private Vector3 <distancePerTick>5__1;

		private float <rotationPerTick>5__2;

		private float <currentRotationX>5__3;

		private float <currentRotationY>5__4;

		private float <currentRotationZ>5__5;

		private int <i>5__6;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <PlayDrawAnimation>d__43(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Expected O, but got Unknown
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
			{
				<>1__state = -1;
				Log("PlayDrawAnimation Started", (bool)((ModSetting)Main.debugging).SavedValue);
				<distancePerTick>5__1 = card.transform.localPosition / (float)ticks;
				<rotationPerTick>5__2 = 180f / (float)ticks;
				Quaternion localRotation = card.transform.localRotation;
				<currentRotationX>5__3 = ((Quaternion)(ref localRotation)).eulerAngles.x;
				localRotation = card.transform.localRotation;
				<currentRotationY>5__4 = ((Quaternion)(ref localRotation)).eulerAngles.y;
				localRotation = card.transform.localRotation;
				<currentRotationZ>5__5 = ((Quaternion)(ref localRotation)).eulerAngles.z;
				<i>5__6 = 0;
				break;
			}
			case 1:
				<>1__state = -1;
				<i>5__6++;
				break;
			}
			if (<i>5__6 < 25)
			{
				Transform transform = card.transform;
				transform.localPosition -= <distancePerTick>5__1;
				if (playRotate)
				{
					<currentRotationX>5__3 -= <rotationPerTick>5__2;
					card.transform.localRotation = Quaternion.Euler(<currentRotationX>5__3, <currentRotationY>5__4, <currentRotationZ>5__5);
				}
				<>2__current = (object)new WaitForFixedUpdate();
				<>1__state = 1;
				return true;
			}
			Log("PlayDrawAnimation Completed", (bool)((ModSetting)Main.debugging).SavedValue);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <PlayHands>d__40 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public BlackJack <>4__this;

		private int <thisHand>5__1;

		private object <playDrawAnimationCoroutine>5__2;

		private object <playDrawAnimationCoroutine2>5__3;

		private object <playDrawAnimationCoroutine3>5__4;

		private object <playDrawAnimationCoroutine4>5__5;

		private object <optionsMenuCoroutine>5__6;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <PlayHands>d__40(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<playDrawAnimationCoroutine>5__2 = null;
			<playDrawAnimationCoroutine2>5__3 = null;
			<playDrawAnimationCoroutine3>5__4 = null;
			<playDrawAnimationCoroutine4>5__5 = null;
			<optionsMenuCoroutine>5__6 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ba: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				Log("PlayHands Running", (bool)((ModSetting)Main.debugging).SavedValue);
				<>4__this.hand = new List<List<int>>();
				<>4__this.dealerHand = new List<int>();
				<>4__this.has21Immediately = false;
				<>4__this.SetupCardSpots();
				<thisHand>5__1 = <>4__this.hand.Count;
				<>4__this.hand.Add(new List<int>());
				<>4__this.hand[<>4__this.hand.Count - 1].Add(<>4__this.DrawCard());
				Log("Player Card 1: " + <>4__this.tableInstance.CardString[<>4__this.hand[<>4__this.hand.Count - 1][0]], (bool)((ModSetting)Main.debugging).SavedValue);
				<playDrawAnimationCoroutine>5__2 = <>4__this.PlayDrawCardAnimation(<>4__this.hand[<>4__this.hand.Count - 1][0], <>4__this.cardSpots.transform.GetChild(0).GetChild(0), <>4__this.tableInstance.dealerDeck.transform.GetChild(0).GetChild(0).position, Quaternion.Euler(-180f, 0f, 0f));
				<>2__current = <playDrawAnimationCoroutine>5__2;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.dealerHand.Add(<>4__this.DrawCard());
				Log("Dealer Card 1: " + <>4__this.tableInstance.CardString[<>4__this.dealerHand[0]], (bool)((ModSetting)Main.debugging).SavedValue);
				<playDrawAnimationCoroutine2>5__3 = <>4__this.PlayDrawCardAnimation(<>4__this.dealerHand[0], <>4__this.cardSpots.transform.GetChild(1).GetChild(0), <>4__this.tableInstance.dealerDeck.transform.GetChild(0).GetChild(0).position, Quaternion.Euler(-180f, 0f, 0f));
				<>2__current = <playDrawAnimationCoroutine2>5__3;
				<>1__state = 2;
				return true;
			case 2:
				<>1__state = -1;
				<>4__this.hand[<>4__this.hand.Count - 1].Add(<>4__this.DrawCard());
				Log("Player Card 2: " + <>4__this.tableInstance.CardString[<>4__this.hand[<>4__this.hand.Count - 1][1]], (bool)((ModSetting)Main.debugging).SavedValue);
				<playDrawAnimationCoroutine3>5__4 = <>4__this.PlayDrawCardAnimation(<>4__this.hand[<>4__this.hand.Count - 1][1], <>4__this.cardSpots.transform.GetChild(0).GetChild(1), <>4__this.tableInstance.dealerDeck.transform.GetChild(0).GetChild(0).position, Quaternion.Euler(-180f, 0f, 0f));
				<>2__current = <playDrawAnimationCoroutine3>5__4;
				<>1__state = 3;
				return true;
			case 3:
				<>1__state = -1;
				<>4__this.dealerHand.Add(<>4__this.DrawCard());
				Log("Dealer Card 2: -_-", (bool)((ModSetting)Main.debugging).SavedValue);
				<playDrawAnimationCoroutine4>5__5 = <>4__this.PlayDrawCardAnimation(52, <>4__this.cardSpots.transform.GetChild(1).GetChild(1), <>4__this.tableInstance.dealerDeck.transform.GetChild(0).GetChild(0).position, Quaternion.Euler(-180f, 0f, 0f), playRotate: false);
				<>2__current = <playDrawAnimationCoroutine4>5__5;
				<>1__state = 4;
				return true;
			case 4:
				<>1__state = -1;
				if (<>4__this.GetCardsTotal(<>4__this.hand[<thisHand>5__1]) == 21)
				{
					<>4__this.has21Immediately = true;
					break;
				}
				<optionsMenuCoroutine>5__6 = MelonCoroutines.Start(<>4__this.RunOptionsMenu(<thisHand>5__1));
				<>2__current = <optionsMenuCoroutine>5__6;
				<>1__state = 5;
				return true;
			case 5:
				<>1__state = -1;
				<optionsMenuCoroutine>5__6 = null;
				break;
			}
			Log("PlayHands Completed", (bool)((ModSetting)Main.debugging).SavedValue);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <PlayPlayerBust>d__30 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public List<GameObject> handCards;

		public BlackJack <>4__this;

		private List<object> <cardsReacting>5__1;

		private int <i>5__2;

		private List<object>.Enumerator <>s__3;

		private object <card>5__4;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <PlayPlayerBust>d__30(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || num == 1)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
			<cardsReacting>5__1 = null;
			<>s__3 = default(List<object>.Enumerator);
			<card>5__4 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					Log("PlayPlayerBust Started", (bool)((ModSetting)Main.debugging).SavedValue);
					<cardsReacting>5__1 = new List<object>();
					<i>5__2 = 0;
					while (<i>5__2 < handCards.Count)
					{
						<cardsReacting>5__1.Add(MelonCoroutines.Start(<>4__this.PlayCardBustCoroutine(handCards[<i>5__2])));
						<i>5__2++;
					}
					<>s__3 = <cardsReacting>5__1.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<card>5__4 = null;
					break;
				}
				if (<>s__3.MoveNext())
				{
					<card>5__4 = <>s__3.Current;
					<>2__current = <card>5__4;
					<>1__state = 1;
					return true;
				}
				<>m__Finally1();
				<>s__3 = default(List<object>.Enumerator);
				Log("PlayPlayerBust Completed", (bool)((ModSetting)Main.debugging).SavedValue);
				return false;
			}
			catch
			{
				//try-fault
				((IDisposable)this).Dispose();
				throw;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			((IDisposable)<>s__3).Dispose();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <PlayPlayerWin>d__27 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public List<GameObject> handCards;

		public List<GameObject> dealerCards;

		public BlackJack <>4__this;

		private List<object> <cardsReacting>5__1;

		private int <i>5__2;

		private int <i>5__3;

		private List<object>.Enumerator <>s__4;

		private object <card>5__5;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <PlayPlayerWin>d__27(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || num == 1)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
			<cardsReacting>5__1 = null;
			<>s__4 = default(List<object>.Enumerator);
			<card>5__5 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					Log("PlayPlayerWin Started", (bool)((ModSetting)Main.debugging).SavedValue);
					<cardsReacting>5__1 = new List<object>();
					<i>5__2 = 0;
					while (<i>5__2 < handCards.Count)
					{
						<cardsReacting>5__1.Add(<>4__this.PlayCardReact(handCards[<i>5__2], win: true, isPlayer: true));
						<i>5__2++;
					}
					<i>5__3 = 0;
					while (<i>5__3 < dealerCards.Count)
					{
						<cardsReacting>5__1.Add(<>4__this.PlayCardReact(dealerCards[<i>5__3], win: false, isPlayer: false));
						<i>5__3++;
					}
					<>s__4 = <cardsReacting>5__1.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<card>5__5 = null;
					break;
				}
				if (<>s__4.MoveNext())
				{
					<card>5__5 = <>s__4.Current;
					<>2__current = <card>5__5;
					<>1__state = 1;
					return true;
				}
				<>m__Finally1();
				<>s__4 = default(List<object>.Enumerator);
				Log("PlayPlayerWin Completed", (bool)((ModSetting)Main.debugging).SavedValue);
				return false;
			}
			catch
			{
				//try-fault
				((IDisposable)this).Dispose();
				throw;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			((IDisposable)<>s__4).Dispose();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <RevealDealerCard>d__36 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public BlackJack <>4__this;

		private float <rotationPerTick>5__1;

		private Transform <dealerCard>5__2;

		private GameObject <newCard>5__3;

		private float <currentRotationX>5__4;

		private float <currentRotationY>5__5;

		private float <currentRotationZ>5__6;

		private int <i>5__7;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <RevealDealerCard>d__36(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<dealerCard>5__2 = null;
			<newCard>5__3 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
			{
				<>1__state = -1;
				Log("RevealDealerCard Started", (bool)((ModSetting)Main.debugging).SavedValue);
				<rotationPerTick>5__1 = 7.2f;
				<dealerCard>5__2 = <>4__this.cardSpots.transform.GetChild(1).GetChild(1).GetChild(0);
				<newCard>5__3 = Object.Instantiate<GameObject>(((Component)<>4__this.tableInstance.storedDeckOfCards.transform.GetChild(<>4__this.dealerHand[1])).gameObject);
				<newCard>5__3.transform.SetParent(((Component)<dealerCard>5__2).transform.parent);
				<newCard>5__3.transform.position = ((Component)<dealerCard>5__2).transform.position;
				<newCard>5__3.transform.rotation = ((Component)<dealerCard>5__2).transform.rotation;
				<newCard>5__3.transform.localScale = ((Component)<dealerCard>5__2).transform.localScale;
				Quaternion localRotation = <newCard>5__3.transform.localRotation;
				<currentRotationX>5__4 = ((Quaternion)(ref localRotation)).eulerAngles.x;
				localRotation = <newCard>5__3.transform.localRotation;
				<currentRotationY>5__5 = ((Quaternion)(ref localRotation)).eulerAngles.y;
				localRotation = <newCard>5__3.transform.localRotation;
				<currentRotationZ>5__6 = ((Quaternion)(ref localRotation)).eulerAngles.z;
				Object.Destroy((Object)(object)((Component)<dealerCard>5__2).gameObject);
				<i>5__7 = 0;
				break;
			}
			case 1:
				<>1__state = -1;
				<i>5__7++;
				break;
			}
			if (<i>5__7 < 25)
			{
				<currentRotationX>5__4 -= <rotationPerTick>5__1;
				<newCard>5__3.transform.localRotation = Quaternion.Euler(<currentRotationX>5__4, <currentRotationY>5__5, <currentRotationZ>5__6);
				<>2__current = (object)new WaitForFixedUpdate();
				<>1__state = 1;
				return true;
			}
			Log("Completed Rotation", (bool)((ModSetting)Main.debugging).SavedValue);
			Log("RevealDealerCard Completed", (bool)((ModSetting)Main.debugging).SavedValue);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <Run>d__22 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public BlackJack <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <Run>d__22(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				Log("Run Running", (bool)((ModSetting)Main.debugging).SavedValue);
				<>4__this.SetupStart();
				<>4__this.gameLoopCoroutine = MelonCoroutines.Start(<>4__this.GameLoop());
				<>2__current = <>4__this.gameLoopCoroutine;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				Log("Run Completed", (bool)((ModSetting)Main.debugging).SavedValue);
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <RunBetMenu>d__44 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public BlackJack <>4__this;

		private GameObject <betsMenu>5__1;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <RunBetMenu>d__44(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<betsMenu>5__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				Log("RunBetMenu Started", (bool)((ModSetting)Main.debugging).SavedValue);
				<>4__this.betAmount = 1;
				<betsMenu>5__1 = <>4__this.SpawnBetsMenu();
				Log("Spawned Bets Menu, Waiting for Accepted Bet", (bool)((ModSetting)Main.debugging).SavedValue);
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			if (!<>4__this.betAccepted && !<>4__this.userQuits)
			{
				<>2__current = (object)new WaitForFixedUpdate();
				<>1__state = 1;
				return true;
			}
			if (<>4__this.betAccepted)
			{
				<>4__this.betHeldAmount = <>4__this.betAmount;
				Log("Bet Accepted, Bet: " + <>4__this.betAmount, (bool)((ModSetting)Main.debugging).SavedValue);
			}
			Log("RunBetMenu Completed", (bool)((ModSetting)Main.debugging).SavedValue);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <RunOptionsMenu>d__55 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public int thisHand;

		public BlackJack <>4__this;

		private GameObject <optionsMenu>5__1;

		private object <playDrawAnimationCoroutine>5__2;

		private object <optionsInOptionsMenuCoroutine>5__3;

		private List<int> <secondHand>5__4;

		private string <cardsString>5__5;

		private object <drawSplitCoroutine>5__6;

		private int <secondHandSpot>5__7;

		private List<int>.Enumerator <>s__8;

		private int <i>5__9;

		private List<int>.Enumerator <>s__10;

		private int <i>5__11;

		private object <runOptionsMenuCoroutine>5__12;

		private object <runOptionsMenuCoroutine>5__13;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <RunOptionsMenu>d__55(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<optionsMenu>5__1 = null;
			<playDrawAnimationCoroutine>5__2 = null;
			<optionsInOptionsMenuCoroutine>5__3 = null;
			<secondHand>5__4 = null;
			<cardsString>5__5 = null;
			<drawSplitCoroutine>5__6 = null;
			<>s__8 = default(List<int>.Enumerator);
			<>s__10 = default(List<int>.Enumerator);
			<runOptionsMenuCoroutine>5__12 = null;
			<runOptionsMenuCoroutine>5__13 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_082f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0839: Expected O, but got Unknown
			//IL_0967: Unknown result type (might be due to invalid IL or missing references)
			//IL_0971: Expected O, but got Unknown
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Expected O, but got Unknown
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				Log("RunOptionsMenu Started", (bool)((ModSetting)Main.debugging).SavedValue);
				<optionsMenu>5__1 = <>4__this.SpawnOptionsMenu(thisHand);
				Log("Spawned Options Menu, Waiting for Selection", (bool)((ModSetting)Main.debugging).SavedValue);
				goto IL_00da;
			case 1:
				<>1__state = -1;
				goto IL_00da;
			case 2:
				<>1__state = -1;
				if (<>4__this.GetCardsTotal(<>4__this.hand[thisHand]) < 21)
				{
					<optionsInOptionsMenuCoroutine>5__3 = MelonCoroutines.Start(<>4__this.RunOptionsMenu(thisHand));
					<>2__current = <optionsInOptionsMenuCoroutine>5__3;
					<>1__state = 3;
					return true;
				}
				if (<>4__this.GetCardsTotal(<>4__this.hand[thisHand]) > 21)
				{
					Log("Player Bust, Total: " + <>4__this.GetCardsTotal(<>4__this.hand[thisHand]), (bool)((ModSetting)Main.debugging).SavedValue);
				}
				else
				{
					Log("Player Got 21, Stopping Hand", (bool)((ModSetting)Main.debugging).SavedValue);
				}
				goto IL_03fc;
			case 3:
				<>1__state = -1;
				<optionsInOptionsMenuCoroutine>5__3 = null;
				goto IL_03fc;
			case 4:
				<>1__state = -1;
				if (<>4__this.GetCardsTotal(<>4__this.hand[thisHand]) < 21)
				{
					<runOptionsMenuCoroutine>5__12 = MelonCoroutines.Start(<>4__this.RunOptionsMenu(thisHand));
					<>2__current = <runOptionsMenuCoroutine>5__12;
					<>1__state = 5;
					return true;
				}
				<>2__current = (object)new WaitForSeconds(1f);
				<>1__state = 6;
				return true;
			case 5:
				<>1__state = -1;
				<runOptionsMenuCoroutine>5__12 = null;
				goto IL_0849;
			case 6:
				<>1__state = -1;
				goto IL_0849;
			case 7:
				<>1__state = -1;
				if (<>4__this.GetCardsTotal(<>4__this.hand[<secondHandSpot>5__7]) <= 21)
				{
					<runOptionsMenuCoroutine>5__13 = MelonCoroutines.Start(<>4__this.RunOptionsMenu(<secondHandSpot>5__7));
					<>2__current = <runOptionsMenuCoroutine>5__13;
					<>1__state = 8;
					return true;
				}
				goto IL_0961;
			case 8:
				<>1__state = -1;
				<runOptionsMenuCoroutine>5__13 = null;
				goto IL_0961;
			case 9:
				{
					<>1__state = -1;
					<secondHand>5__4 = null;
					<cardsString>5__5 = null;
					<drawSplitCoroutine>5__6 = null;
					break;
				}
				IL_00da:
				if (!<>4__this.pressedStay && !<>4__this.pressedHit && !<>4__this.pressedSplit)
				{
					<>2__current = (object)new WaitForFixedUpdate();
					<>1__state = 1;
					return true;
				}
				Object.Destroy((Object)(object)<optionsMenu>5__1);
				if (<>4__this.pressedHit)
				{
					Log("Pressed Hit", (bool)((ModSetting)Main.debugging).SavedValue);
					<>4__this.hand[thisHand].Add(<>4__this.DrawCard());
					Log($"Player Card {<>4__this.hand[thisHand].Count}: {<>4__this.tableInstance.CardString[<>4__this.hand[thisHand][<>4__this.hand[thisHand].Count - 1]]}", (bool)((ModSetting)Main.debugging).SavedValue);
					<playDrawAnimationCoroutine>5__2 = <>4__this.PlayDrawCardAnimation(<>4__this.hand[thisHand][<>4__this.hand[thisHand].Count - 1], <>4__this.cardSpots.transform.GetChild(0).GetChild(<>4__this.hand[thisHand].Count - 1), <>4__this.tableInstance.dealerDeck.transform.GetChild(0).GetChild(0).position, Quaternion.Euler(-180f, 0f, 0f));
					<>2__current = <playDrawAnimationCoroutine>5__2;
					<>1__state = 2;
					return true;
				}
				if (<>4__this.pressedStay)
				{
					Log("Pressed Stay", (bool)((ModSetting)Main.debugging).SavedValue);
				}
				else
				{
					if (!<>4__this.pressedSplit)
					{
						break;
					}
					Log("Pressed Split", (bool)((ModSetting)Main.debugging).SavedValue);
					Log("Player Split Bet Accepted: " + <>4__this.betAmount);
					Main.Payout(-<>4__this.betAmount, 1f, <>4__this.tableInstance);
					<>4__this.betHeldAmount += <>4__this.betAmount;
					<secondHand>5__4 = new List<int>();
					<secondHand>5__4.Add(-1);
					<secondHand>5__4.Add(<>4__this.hand[thisHand][1]);
					<>4__this.hand[thisHand][1] = -1;
					<cardsString>5__5 = "";
					<>s__8 = <>4__this.hand[thisHand].GetEnumerator();
					try
					{
						while (<>s__8.MoveNext())
						{
							<i>5__9 = <>s__8.Current;
							if (<i>5__9 != -1)
							{
								<cardsString>5__5 += <>4__this.tableInstance.CardString[<i>5__9];
							}
							else
							{
								<cardsString>5__5 += "-1";
							}
							<cardsString>5__5 += " ";
						}
					}
					finally
					{
						((IDisposable)<>s__8).Dispose();
					}
					<>s__8 = default(List<int>.Enumerator);
					Log($"Hand {thisHand}: {<cardsString>5__5}", (bool)((ModSetting)Main.debugging).SavedValue);
					<cardsString>5__5 = "";
					<>s__10 = <secondHand>5__4.GetEnumerator();
					try
					{
						while (<>s__10.MoveNext())
						{
							<i>5__11 = <>s__10.Current;
							if (<i>5__11 != -1)
							{
								<cardsString>5__5 += <>4__this.tableInstance.CardString[<i>5__11];
							}
							else
							{
								<cardsString>5__5 += "-1";
							}
							<cardsString>5__5 += " ";
						}
					}
					finally
					{
						((IDisposable)<>s__10).Dispose();
					}
					<>s__10 = default(List<int>.Enumerator);
					Log("Next Hand: " + <cardsString>5__5, (bool)((ModSetting)Main.debugging).SavedValue);
					<>4__this.ClearVisualCardsFromAHand(isPlayer: true);
					Log("Playing First Hand", (bool)((ModSetting)Main.debugging).SavedValue);
					<drawSplitCoroutine>5__6 = MelonCoroutines.Start(<>4__this.DrawSplit(thisHand));
					<>2__current = <drawSplitCoroutine>5__6;
					<>1__state = 4;
					return true;
				}
				break;
				IL_0961:
				<>2__current = (object)new WaitForSeconds(1f);
				<>1__state = 9;
				return true;
				IL_0849:
				Log("Setting Up For Next Hand", (bool)((ModSetting)Main.debugging).SavedValue);
				<>4__this.ClearVisualCardsFromAHand(isPlayer: true);
				<>4__this.hand.Add(<secondHand>5__4);
				<secondHandSpot>5__7 = <>4__this.hand.Count - 1;
				Log("Playing Next Hand", (bool)((ModSetting)Main.debugging).SavedValue);
				<drawSplitCoroutine>5__6 = MelonCoroutines.Start(<>4__this.DrawSplit(<secondHandSpot>5__7, recreateOriginal: true));
				<>2__current = <drawSplitCoroutine>5__6;
				<>1__state = 7;
				return true;
				IL_03fc:
				<playDrawAnimationCoroutine>5__2 = null;
				break;
			}
			Log("RunOptionsMenu Completed", (bool)((ModSetting)Main.debugging).SavedValue);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <ShufflingCard>d__49 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public GameObject card;

		public object spinCoroutine;

		public BlackJack <>4__this;

		private Transform <cardsParent>5__1;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <ShufflingCard>d__49(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<cardsParent>5__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<cardsParent>5__1 = <>4__this.tableInstance.dealerDeck.transform.GetChild(0).GetChild(0).GetChild(0);
				<>2__current = spinCoroutine;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				break;
			case 2:
				<>1__state = -1;
				<>2__current = (object)new WaitForFixedUpdate();
				<>1__state = 3;
				return true;
			case 3:
				<>1__state = -1;
				break;
			}
			if (<>4__this.continueShuffling && (Object)(object)<>4__this.tableInstance.blackJackInstance != (Object)null)
			{
				spinCoroutine = MelonCoroutines.Start(<>4__this.tableInstance.SpinCard(card));
				<>2__current = spinCoroutine;
				<>1__state = 2;
				return true;
			}
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private int betAmount = 1;

	private int betHeldAmount = 0;

	private bool gameLoopRunning = false;

	private TextMeshPro betTextComponent = null;

	private GameObject storedBetsMenu = null;

	private GameObject storedOptionsMenu = null;

	private bool betAccepted = false;

	private bool userQuits = false;

	private List<int> deck;

	private List<int> dealerHand;

	private List<List<int>> hand;

	public object gameLoopCoroutine = null;

	private Transform storedGamePartsTransform = null;

	private Transform activeGamePartsTransform = null;

	private Table tableInstance;

	private GameObject cardSpots = null;

	private bool has21Immediately = false;

	private int coinsGained = 0;

	private bool continueShuffling = true;

	private bool pressedStay;

	private bool pressedHit;

	private bool pressedSplit;

	public BlackJack(Table tableInstance)
	{
		this.tableInstance = tableInstance;
	}

	public static void Log(string msg, bool sendMsg = true)
	{
		if (sendMsg)
		{
			Table.Log("BlackJack - " + msg, sendMsg);
		}
	}

	public static void Warn(string msg, bool sendMsg = true)
	{
		if (sendMsg)
		{
			Table.Warn("BlackJack - " + msg, sendMsg);
		}
	}

	public static void Error(string msg)
	{
		Table.Error("BlackJack - " + msg);
	}

	public void ShowSplash()
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: 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)
		storedGamePartsTransform = ((Component)tableInstance).transform.GetChild(1);
		activeGamePartsTransform = ((Component)tableInstance).transform.GetChild(2);
		GameObject val = new GameObject("SplashScreen");
		val.transform.SetParent(activeGamePartsTransform);
		val.transform.localPosition = new Vector3(0f, 0.9454f, 0f);
		val.transform.localRotation = Quaternion.identity;
		val.transform.localScale = Vector3.one;
		GameObject val2 = tableInstance.SpawnText(val.transform, "BlackJack", new Vector3(0f, 0f, 0.4f), Quaternion.Euler(90f, 180f, 0f), new Vector3(1.25f, 1.25f, 1.25f));
		TextMeshPro component = val2.GetComponent<TextMeshPro>();
		((TMP_Text)component).alignment = (TextAlignmentOptions)514;
		((TMP_Text)component).enableWordWrapping = false;
	}

	[IteratorStateMachine(typeof(<Run>d__22))]
	public IEnumerator Run()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <Run>d__22(0)
		{
			<>4__this = this
		};
	}

	private void SetupStart()
	{
		Log("SetupStart Running", (bool)((ModSetting)Main.debugging).SavedValue);
		gameLoopRunning = false;
		RandomizeDeck();
		SetupBetMenu();
		SetupOptionsMenu();
		Log("SetupStart Completed", (bool)((ModSetting)Main.debugging).SavedValue);
	}

	private void SetupCardSpots()
	{
		//IL_0050: 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_007c: Unknown result type (might be due to invalid IL or missing references)
		cardSpots = Object.Instantiate<GameObject>(((Component)storedGamePartsTransform.GetChild(1)).gameObject);
		((Object)cardSpots).name = "CardSpots";
		cardSpots.transform.SetParent(activeGamePartsTransform);
		cardSpots.transform.localPosition = Vector3.zero;
		cardSpots.transform.localRotation = Quaternion.identity;
		cardSpots.transform.localScale = Vector3.one;
	}

	[IteratorStateMachine(typeof(<GameLoop>d__26))]
	private IEnumerator GameLoop()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <GameLoop>d__26(0)
		{
			<>4__this = this
		};
	}

	[IteratorStateMachine(typeof(<PlayPlayerWin>d__27))]
	private IEnumerator PlayPlayerWin(List<GameObject> handCards, List<GameObject> dealerCards)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <PlayPlayerWin>d__27(0)
		{
			<>4__this = this,
			handCards = handCards,
			dealerCards = dealerCards
		};
	}

	private object PlayCardReact(GameObject card, bool win, bool isPlayer)
	{
		return MelonCoroutines.Start(PlayCardReactCoroutine(card, win, isPlayer));
	}

	[IteratorStateMachine(typeof(<PlayCardReactCoroutine>d__29))]
	private IEnumerator PlayCardReactCoroutine(GameObject card, bool win, bool isPlayer)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <PlayCardReactCoroutine>d__29(0)
		{
			<>4__this = this,
			card = card,
			win = win,
			isPlayer = isPlayer
		};
	}

	[IteratorStateMachine(typeof(<PlayPlayerBust>d__30))]
	private IEnumerator PlayPlayerBust(List<GameObject> handCards)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <PlayPlayerBust>d__30(0)
		{
			<>4__this = this,
			handCards = handCards
		};
	}

	[IteratorStateMachine(typeof(<PlayDealerBust>d__31))]
	private IEnumerator PlayDealerBust(List<GameObject> handCards)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <PlayDealerBust>d__31(0)
		{
			<>4__this = this,
			handCards = handCards
		};
	}

	[IteratorStateMachine(typeof(<PlayCardBustCoroutine>d__32))]
	private IEnumerator PlayCardBustCoroutine(GameObject card)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <PlayCardBustCoroutine>d__32(0)
		{
			<>4__this = this,
			card = card
		};
	}

	[IteratorStateMachine(typeof(<PlayDealerWin>d__33))]
	private IEnumerator PlayDealerWin(List<GameObject> handCards, List<GameObject> dealerCards)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <PlayDealerWin>d__33(0)
		{
			<>4__this = this,
			handCards = handCards,
			dealerCards = dealerCards
		};
	}

	private List<GameObject> SpawnHandCards(int thisHand)
	{
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		List<GameObject> list = new List<GameObject>();
		for (int i = 0; i < hand[thisHand].Count; i++)
		{
			GameObject val = Object.Instantiate<GameObject>(((Component)tableInstance.storedDeckOfCards.transform.GetChild(hand[thisHand][i])).gameObject);
			val.transform.SetParent(cardSpots.transform.GetChild(0).GetChild(i));
			val.transform.localPosition = Vector3.zero;
			val.transform.localRotation = Quaternion.identity;
			list.Add(val);
		}
		return list;
	}

	private List<GameObject> SpawnDealerCards()
	{
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		List<GameObject> list = new List<GameObject>();
		for (int i = 0; i < dealerHand.Count; i++)
		{
			GameObject val = Object.Instantiate<GameObject>(((Component)tableInstance.storedDeckOfCards.transform.GetChild(dealerHand[i])).gameObject);
			val.transform.SetParent(cardSpots.transform.GetChild(1).GetChild(i));
			val.transform.localPosition = Vector3.zero;
			val.transform.localRotation = Quaternion.identity;
			list.Add(val);
		}
		return list;
	}

	[IteratorStateMachine(typeof(<RevealDealerCard>d__36))]
	private IEnumerator RevealDealerCard()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <RevealDealerCard>d__36(0)
		{
			<>4__this = this
		};
	}

	private List<int> GetPlayerHandTotal()
	{
		Log("GetPlayerHandTotal Started", (bool)((ModSetting)Main.debugging).SavedValue);
		List<int> list = new List<int>();
		int num = 0;
		bool flag = false;
		foreach (List<int> item in hand)
		{
			foreach (int item2 in item)
			{
				int num2;
				for (num2 = item2; num2 >= 13; num2 -= 13)
				{
				}
				num2 = Math.Clamp(num2 + 1, 1, 10);
				if (num2 == 1)
				{
					flag = true;
				}
				num += num2;
			}
			if (flag && num <= 11)
			{
				num += 10;
			}
			list.Add(num);
			num = 0;
		}
		Log("GetPlayerHandTotal Completed", (bool)((ModSetting)Main.debugging).SavedValue);
		return list;
	}

	private int GetDealerHandTotal()
	{
		Log("GetDealerHandTotal Started", (bool)((ModSetting)Main.debugging).SavedValue);
		int num = 0;
		bool flag = false;
		foreach (int item in dealerHand)
		{
			int num2;
			for (num2 = item; num2 >= 13; num2 -= 13)
			{
			}
			num2 = Math.Clamp(num2 + 1, 1, 10);
			if (num2 == 1)
			{
				flag = true;
			}
			num += num2;
		}
		if (flag && num <= 11)
		{
			num += 10;
		}
		Log("GetDealerHandTotal Completed", (bool)((ModSetting)Main.debugging).SavedValue);
		return num;
	}

	private int GetCardsTotal(List<int> cards)
	{
		Log("GetCardsTotal Started", (bool)((ModSetting)Main.debugging).SavedValue);
		int num = 0;
		bool flag = false;
		foreach (int card in cards)
		{
			int num2;
			for (num2 = card; num2 >= 13; num2 -= 13)
			{
			}
			num2 = Math.Clamp(num2 + 1, 1, 10);
			if (num2 == 1)
			{
				flag = true;
			}
			num += num2;
			Log($"Card {tableInstance.CardString[card]}: {num2}", (bool)((ModSetting)Main.debugging).SavedValue);
		}
		if (flag && num <= 11)
		{
			num += 10;
			Log("Ace able to be 11", (bool)((ModSetting)Main.debugging).SavedValue);
		}
		Log("GetCardsTotal Completed: " + num, (bool)((ModSetting)Main.debugging).SavedValue);
		return num;
	}

	[IteratorStateMachine(typeof(<PlayHands>d__40))]
	private IEnumerator PlayHands()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <PlayHands>d__40(0)
		{
			<>4__this = this
		};
	}

	private object PlayDrawCardAnimation(int CardToDraw, Transform parent, Vector3 position, Quaternion localRotation, bool playRotate = true)
	{
		//IL_004f: 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)
		Log("PlayDrawCardAnimation Started", (bool)((ModSetting)Main.debugging).SavedValue);
		GameObject val = Object.Instantiate<GameObject>(((Component)tableInstance.storedDeckOfCards.transform.GetChild(CardToDraw)).gameObject);
		val.transform.SetParent(parent);
		val.transform.position = position;
		val.transform.localRotation = localRotation;
		Log("PlayDrawCardAnimation Completed", (bool)((ModSetting)Main.debugging).SavedValue);
		return MelonCoroutines.Start(PlayDrawAnimation(val, 25, playRotate));
	}

	private int DrawCard()
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		if (deck.Count == 0)
		{
			RandomizeDeck();
		}
		int result = deck[0];
		deck.RemoveAt(0);
		tableInstance.dealerDeck.transform.localScale = new Vector3(1f, (float)deck.Count / 52f, 1f);
		return result;
	}

	[IteratorStateMachine(typeof(<PlayDrawAnimation>d__43))]
	private IEnumerator PlayDrawAnimation(GameObject card, int ticks = 25, bool playRotate = true)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <PlayDrawAnimation>d__43(0)
		{
			<>4__this = this,
			card = card,
			ticks = ticks,
			playRotate = playRotate
		};
	}

	[IteratorStateMachine(typeof(<RunBetMenu>d__44))]
	private IEnumerator RunBetMenu()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <RunBetMenu>d__44(0)
		{
			<>4__this = this
		};
	}

	private GameObject SpawnBetsMenu()
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		Log("SpawnBetsMenu Started", (bool)((ModSetting)Main.debugging).SavedValue);
		GameObject val = Object.Instantiate<GameObject>(storedBetsMenu);
		val.transform.SetParent(activeGamePartsTransform);
		val.transform.localPosition = new Vector3(0f, tableInstance.TABLEHEIGHT - 0.052f, 0f);
		val.transform.localRotation = Quaternion.identity;
		val.transform.localScale = Vector3.one;
		betTextComponent = ((Component)val.transform.GetChild(1)).GetComponent<TextMeshPro>();
		UpdateBetAmountText();
		((Component)val.transform.GetChild(2).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("Bet Down Pressed", (bool)((ModSetting)Main.debugging).SavedValue);
			if (1 < betAmount)
			{
				betAmount--;
				Log("New Bet: " + betAmount, (bool)((ModSetting)Main.debugging).SavedValue);
				UpdateBetAmountText();
			}
		}));
		((Component)val.transform.GetChild(3).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("Bet Up Pressed", (bool)((ModSetting)Main.debugging).SavedValue);
			if (Main.GetPlayerCoinCount() >= betAmount + 1)
			{
				betAmount++;
				Log("New Bet: " + betAmount, (bool)((ModSetting)Main.debugging).SavedValue);
				UpdateBetAmountText();
			}
		}));
		((Component)val.transform.GetChild(4).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("Bet Down Pressed", (bool)((ModSetting)Main.debugging).SavedValue);
			if (10 < betAmount)
			{
				betAmount -= 10;
				Log("New Bet: " + betAmount, (bool)((ModSetting)Main.debugging).SavedValue);
				UpdateBetAmountText();
			}
		}));
		((Component)val.transform.GetChild(5).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("Bet Up Pressed", (bool)((ModSetting)Main.debugging).SavedValue);
			if (Main.GetPlayerCoinCount() >= betAmount + 10)
			{
				betAmount += 10;
				Log("New Bet: " + betAmount, (bool)((ModSetting)Main.debugging).SavedValue);
				UpdateBetAmountText();
			}
		}));
		((Component)val.transform.GetChild(6).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("Bet Accepted: " + betAmount, (bool)((ModSetting)Main.debugging).SavedValue);
			betAccepted = true;
			continueShuffling = false;
		}));
		((Component)val.transform.GetChild(7).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("User Quit During Betting", (bool)((ModSetting)Main.debugging).SavedValue);
			userQuits = true;
			continueShuffling = false;
		}));
		((Component)val.transform.GetChild(8).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("Bet Min Pressed", (bool)((ModSetting)Main.debugging).SavedValue);
			betAmount = 1;
			Log("New Bet: " + betAmount, (bool)((ModSetting)Main.debugging).SavedValue);
			UpdateBetAmountText();
		}));
		((Component)val.transform.GetChild(9).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("Bet Max Pressed", (bool)((ModSetting)Main.debugging).SavedValue);
			betAmount = Main.GetPlayerCoinCount();
			Log("New Bet: " + betAmount, (bool)((ModSetting)Main.debugging).SavedValue);
			UpdateBetAmountText();
		}));
		val.transform.GetChild(9).GetChild(2).localPosition = new Vector3(0f, 0f, -0.25f);
		betAccepted = false;
		userQuits = false;
		Log("SpawnBetsMenu Completed", (bool)((ModSetting)Main.debugging).SavedValue);
		return val;
	}

	private void RandomizeDeck(bool continueShuffling = true)
	{
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		Log("RandomizeDeck Running", (bool)((ModSetting)Main.debugging).SavedValue);
		object[] shufflings = tableInstance.ShuffleDealerDeck();
		if (continueShuffling)
		{
			ContinueShufflings(shufflings);
		}
		deck = new List<int>();
		List<int> list = new List<int>();
		int num = 0;
		for (int i = 0; i < 52 * (int)((ModSetting)Main.deckCount).SavedValue; i++)
		{
			deck.Add(num);
			num++;
			if (num == 52)
			{
				num = 0;
			}
		}
		Log("Deck Setup Done", (bool)((ModSetting)Main.debugging).SavedValue);
		tableInstance.dealerDeck.transform.localScale = new Vector3(1f, (float)deck.Count / 52f, 1f);
		list.Clear();
		while (deck.Count > 0)
		{
			int index = tableInstance.random.Next(deck.Count);
			list.Add(deck[index]);
			deck.RemoveAt(index);
		}
		deck.AddRange(list);
		Log("RandomizeDeck Complete", (bool)((ModSetting)Main.debugging).SavedValue);
	}

	private void ContinueShufflings(object[] shufflings)
	{
		continueShuffling = true;
		Transform child = tableInstance.dealerDeck.transform.GetChild(0).GetChild(0).GetChild(0);
		for (int i = 0; i < shufflings.Length; i++)
		{
			MelonCoroutines.Start(ShufflingCard(((Component)((Component)child).transform.GetChild(i)).gameObject, shufflings[i]));
		}
	}

	[IteratorStateMachine(typeof(<ShufflingCard>d__49))]
	private IEnumerator ShufflingCard(GameObject card, object spinCoroutine)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <ShufflingCard>d__49(0)
		{
			<>4__this = this,
			card = card,
			spinCoroutine = spinCoroutine
		};
	}

	private void SetupBetMenu()
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_006d: 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_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_021c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_028a: Unknown result type (might be due to invalid IL or missing references)
		//IL_029e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_032a: Unknown result type (might be due to invalid IL or missing references)
		//IL_033e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0352: Unknown result type (might be due to invalid IL or missing references)
		//IL_0384: Unknown result type (might be due to invalid IL or missing references)
		//IL_0398: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_03de: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_0438: Unknown result type (might be due to invalid IL or missing references)
		//IL_044c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0460: Unknown result type (might be due to invalid IL or missing references)
		Log("SetupBetMenu Started", (bool)((ModSetting)Main.debugging).SavedValue);
		if ((Object)(object)storedBetsMenu != (Object)null)
		{
			Object.Destroy((Object)(object)storedBetsMenu);
		}
		storedBetsMenu = new GameObject("BetsMenu");
		storedBetsMenu.transform.SetParent(storedGamePartsTransform);
		storedBetsMenu.transform.localPosition = Vector3.zero;
		storedBetsMenu.transform.localRotation = Quaternion.identity;
		storedBetsMenu.transform.localScale = Vector3.one;
		GameObject val = tableInstance.SpawnText(storedBetsMenu.transform, "How Much To Bet?", new Vector3(0f, 0f, 0.35f), Quaternion.Euler(90f, 180f, 0f), new Vector3(1.25f, 1.25f, 1.25f));
		TextMeshPro component = val.GetComponent<TextMeshPro>();
		((TMP_Text)component).alignment = (TextAlignmentOptions)514;
		((TMP_Text)component).enableWordWrapping = false;
		GameObject val2 = tableInstance.SpawnText(storedBetsMenu.transform, "BetText", new Vector3(0f, 0f, 0.5f), Quaternion.Euler(90f, 180f, 0f), new Vector3(1f, 1f, 1f));
		TextMeshPro component2 = val2.GetComponent<TextMeshPro>();
		((TMP_Text)component2).alignment = (TextAlignmentOptions)514;
		((TMP_Text)component2).enableWordWrapping = false;
		betTextComponent = val2.GetComponent<TextMeshPro>();
		UpdateBetAmountText();
		GameObject val3 = tableInstance.SpawnButton(storedBetsMenu.transform, "-1", new Vector3(0.15f, 0f, 0.9f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val4 = tableInstance.SpawnButton(storedBetsMenu.transform, "+1", new Vector3(-0.15f, 0f, 0.9f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val5 = tableInstance.SpawnButton(storedBetsMenu.transform, "-10", new Vector3(0.325f, 0f, 0.85f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val6 = tableInstance.SpawnButton(storedBetsMenu.transform, "+10", new Vector3(-0.325f, 0f, 0.85f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val7 = tableInstance.SpawnButton(storedBetsMenu.transform, "Accept", new Vector3(0f, 0f, 0.75f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val8 = tableInstance.SpawnButton(storedBetsMenu.transform, "Exit", new Vector3(0.75f, 0f, 0.25f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val9 = tableInstance.SpawnButton(storedBetsMenu.transform, "Min", new Vector3(0.5f, 0f, 0.8f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val10 = tableInstance.SpawnButton(storedBetsMenu.transform, "Max", new Vector3(-0.5f, 0f, 0.8f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		Log("SetupBetMenu Completed", (bool)((ModSetting)Main.debugging).SavedValue);
	}

	private GameObject SpawnOptionsMenu(int thisHand)
	{
		//IL_006f: 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_0091: 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_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
		Log("SpawnOptionsMenu Started", (bool)((ModSetting)Main.debugging).SavedValue);
		pressedStay = false;
		pressedHit = false;
		pressedSplit = false;
		GameObject val = Object.Instantiate<GameObject>(storedOptionsMenu);
		val.transform.SetParent(activeGamePartsTransform);
		val.transform.localPosition = new Vector3(0f, tableInstance.TABLEHEIGHT - 0.052f, 0f);
		val.transform.localRotation = Quaternion.identity;
		val.transform.localScale = Vector3.one;
		((Component)val.transform.GetChild(0).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("Stay Pressed", (bool)((ModSetting)Main.debugging).SavedValue);
			pressedStay = true;
		}));
		((Component)val.transform.GetChild(1).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
		{
			Log("Hit Pressed", (bool)((ModSetting)Main.debugging).SavedValue);
			pressedHit = true;
		}));
		val.transform.GetChild(1).GetChild(2).localPosition = new Vector3(0f, 0f, -0.25f);
		if (SplitIsPossible(hand[thisHand]))
		{
			((Component)val.transform.GetChild(2).GetChild(0)).GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
			{
				Log("Split Pressed", (bool)((ModSetting)Main.debugging).SavedValue);
				pressedSplit = true;
			}));
			val.transform.GetChild(2).GetChild(2).localPosition = new Vector3(0f, 0f, -0.25f);
			((Component)val.transform.GetChild(2)).gameObject.SetActive(true);
		}
		((TMP_Text)((Component)val.transform.GetChild(3)).GetComponent<TextMeshPro>()).text = GetPlayerHandTotal()[thisHand].ToString();
		val.transform.GetChild(3).localPosition = new Vector3(-0.15f, 0f, 0.6f);
		((Component)val.transform.GetChild(3)).gameObject.SetActive((bool)((ModSetting)Main.showHandCount).SavedValue);
		int num;
		for (num = dealerHand[0]; num >= 13; num -= 13)
		{
		}
		string text = Math.Min(num + 1, 10).ToString();
		((TMP_Text)((Component)val.transform.GetChild(4)).GetComponent<TextMeshPro>()).text = text;
		((Component)val.transform.GetChild(4)).gameObject.SetActive((bool)((ModSetting)Main.showHandCount).SavedValue);
		val.transform.GetChild(4).localPosition = new Vector3(-0.15f, 0f, 0.55f);
		((Component)val.transform.GetChild(4)).gameObject.SetActive((bool)((ModSetting)Main.showHandCount).SavedValue);
		Log("SpawnOptionsMenu Completed", (bool)((ModSetting)Main.debugging).SavedValue);
		return val;
	}

	[IteratorStateMachine(typeof(<RunOptionsMenu>d__55))]
	private IEnumerator RunOptionsMenu(int thisHand)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <RunOptionsMenu>d__55(0)
		{
			<>4__this = this,
			thisHand = thisHand
		};
	}

	private void ClearVisualCardsFromAHand(bool isPlayer)
	{
		Log("Clearing " + (isPlayer ? "Player's" : "Dealer's") + " Cards", (bool)((ModSetting)Main.debugging).SavedValue);
		int num = ((!isPlayer) ? 1 : 0);
		for (int i = 0; i < cardSpots.transform.GetChild(num).GetChildCount(); i++)
		{
			for (int num2 = cardSpots.transform.GetChild(num).GetChild(i).childCount - 1; num2 >= 0; num2--)
			{
				Object.Destroy((Object)(object)((Component)cardSpots.transform.GetChild(num).GetChild(i).GetChild(num2)).gameObject);
			}
		}
	}

	[IteratorStateMachine(typeof(<DrawSplit>d__57))]
	private IEnumerator DrawSplit(int thisHand, bool recreateOriginal = false)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <DrawSplit>d__57(0)
		{
			<>4__this = this,
			thisHand = thisHand,
			recreateOriginal = recreateOriginal
		};
	}

	[IteratorStateMachine(typeof(<DealersTurn>d__58))]
	private IEnumerator DealersTurn()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <DealersTurn>d__58(0)
		{
			<>4__this = this
		};
	}

	[IteratorStateMachine(typeof(<DealerDraw>d__59))]
	private IEnumerator DealerDraw()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <DealerDraw>d__59(0)
		{
			<>4__this = this
		};
	}

	private void SetupOptionsMenu()
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_006d: 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_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_025c: Unknown result type (might be due to invalid IL or missing references)
		Log("SetupOptionsMenu Started", (bool)((ModSetting)Main.debugging).SavedValue);
		if ((Object)(object)storedOptionsMenu != (Object)null)
		{
			Object.Destroy((Object)(object)storedOptionsMenu);
		}
		storedOptionsMenu = new GameObject("OptionsMenu");
		storedOptionsMenu.transform.SetParent(storedGamePartsTransform);
		storedOptionsMenu.transform.localPosition = Vector3.zero;
		storedOptionsMenu.transform.localRotation = Quaternion.identity;
		storedOptionsMenu.transform.localScale = Vector3.one;
		GameObject val = tableInstance.SpawnButton(storedOptionsMenu.transform, "Stay", new Vector3(0.25f, 0f, 0.9f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val2 = tableInstance.SpawnButton(storedOptionsMenu.transform, "Hit", new Vector3(-0.25f, 0f, 0.9f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val3 = tableInstance.SpawnButton(storedOptionsMenu.transform, "Split", new Vector3(0f, 0f, 0.95f), Quaternion.Euler(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		val3.SetActive(false);
		GameObject val4 = tableInstance.SpawnText(storedOptionsMenu.transform, "Hand", new Vector3(-0.15f, 0f, 0.6f), Quaternion.Euler(90f, 180f, 0f), new Vector3(0.5f, 0.5f, 0.5f));
		GameObject val5 = tableInstance.SpawnText(storedOptionsMenu.transform, "Hand", new Vector3(-0.15f, 0f, 0.5f), Quaternion.Euler(90f, 180f, 0f), new Vector3(0.5f, 0.5f, 0.55f));
		val5.SetActive(false);
		Log("SetupOptionsMenu Completed", (bool)((ModSetting)Main.debugging).SavedValue);
	}

	private bool SplitIsPossible(List<int> thisHand)
	{
		int num = thisHand[0];
		int num2 = thisHand[1];
		while (num >= 13)
		{
			num -= 13;
		}
		while (num2 >= 13)
		{
			num2 -= 13;
		}
		Log("Is Split Possible: " + (num == num2 && (tableInstance.freePlay || Main.GetPlayerCoinCount() >= betAmount + betHeldAmount)), (bool)((ModSetting)Main.debugging).SavedValue);
		return num == num2 && Main.GetPlayerCoinCount() >= betAmount + betHeldAmount;
	}

	private void UpdateBetAmountText()
	{
		((TMP_Text)betTextComponent).text = betAmount + " of " + Main.GetPlayerCoinCount();
	}
}
[RegisterTypeInIl2Cpp]
public class InteractionLever : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <PullLever>d__12 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public InteractionLever <>4__this;

		private float <fingerRotation>5__1;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <PullLever>d__12(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_007d: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			Quaternion localRotation;
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				localRotation = <>4__this.lastInteractedHand.transform.GetChild(3).GetChild(0).localRotation;
				<fingerRotation>5__1 = ((Quaternion)(ref localRotation)).eulerAngles.x;
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			if (<>4__this.leverReleaseCoroutine == null && <fingerRotation>5__1 >= 45f)
			{
				try
				{
					localRotation = <>4__this.lastInteractedHand.transform.GetChild(3).GetChild(0).localRotation;
					<fingerRotation>5__1 = ((Quaternion)(ref localRotation)).eulerAngles.x;
					<>4__this.RotateLever();
				}
				catch
				{
					goto IL_00e5;
				}
				<>2__current = (object)new WaitForFixedUpdate();
				<>1__state = 1;
				return true;
			}
			goto IL_00e5;
			IL_00e5:
			if (<>4__this.leverReleaseCoroutine == null)
			{
				<>4__this.leverReleaseCoroutine = MelonCoroutines.Start(<>4__this.ReleaseLever());
			}
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <ReleaseLever>d__14 : IEnumerator<object>, IEnumerator, IDisposable
	{
		private int <>1__state;

		private object <>2__current;

		public InteractionLever <>4__this;

		private Delegate[] <listeners>5__1;

		private Transform <parent>5__2;

		private int <currentAngle>5__3;

		private int <rotationPerTick>5__4;

		private Delegate[] <listeners2>5__5;

		private Delegate[] <>s__6;

		private int <>s__7;

		private Delegate <listener>5__8;

		private Exception <e>5__9;

		private Delegate[] <>s__10;

		private int <>s__11;

		private Delegate <listener>5__12;

		private Exception <e>5__13;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <ReleaseLever>d__14(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<listeners>5__1 = null;
			<parent>5__2 = null;
			<listeners2>5__5 = null;
			<>s__6 = null;
			<listener>5__8 = null;
			<e>5__9 = null;
			<>s__10 = null;
			<listener>5__12 = null;
			<e>5__13 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be