Decompiled source of Flip Stats Tracker v1.0.0

plugins/flipStatsTracker/unfairflips.dll

Decompiled a day ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using AOT;
using Steamworks;
using TMPro;
using Tweens;
using Tweens.Core;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
public class AudioButton : MonoBehaviour
{
	public Sprite audioOn;

	public Sprite audioOff;

	private Image img;

	private AudioListener audioListener;

	private bool audioEnabled = true;

	private void Start()
	{
		img = ((Component)this).GetComponent<Image>();
		audioListener = Object.FindObjectOfType<AudioListener>();
	}

	public void Click()
	{
		if ((Object)(object)Object.FindObjectOfType<PanelManager>() != (Object)null && Object.FindObjectOfType<PanelManager>().GetCurrentArrangement() == 0)
		{
			Object.FindObjectOfType<PanelManager>().SetPanelArrangement(1);
		}
		audioEnabled = !audioEnabled;
		AudioListener.volume = (audioEnabled ? 1f : 0f);
		img.sprite = (audioEnabled ? audioOn : audioOff);
		if (audioEnabled)
		{
			Object.FindObjectOfType<MessageManager>().ShowMessage("<color=#ffbbbb>SOUND ENABLED</color>");
		}
		else
		{
			Object.FindObjectOfType<MessageManager>().ShowMessage("<color=#ffbbbb>SOUND MUTED</color>");
		}
	}

	private void Update()
	{
	}
}
public class CoinFlip : MonoBehaviour
{
	[Serializable]
	public struct CoinSprites
	{
		public Sprite coinHappy;

		public Sprite coinSad;

		public Sprite coinSmirk;

		public Sprite[] coinSlowFlip;

		public Sprite coinSide;

		public Sprite[] coinRollAway;

		public Sprite[] coinEggbug;

		public Sprite coinExplosion;
	}

	[Serializable]
	public struct TutorialMessage
	{
		public string message;

		public int flipnum;
	}

	public float flipDuration = 5f;

	public float flipHeadsChance = 0.2f;

	public int baseFlipWorthInCents = 1;

	public float flipComboMultiplier = 2f;

	private bool isFlipping;

	private float currentFlipDuration;

	private float flipAnimateDuration = 0.3f;

	private float currentFlipAnimateDuration;

	private float flipMoveSpeed = 5f;

	public Vector2 flipTarget;

	private Vector2 flipBasePosition;

	private float rotationTarget;

	private bool prevWasHeads;

	private int headsComboNum;

	private MessageManager messageManager;

	private PlayerMoney playerMoney;

	private int currentCoin;

	private PanelManager panelManager;

	private int numFlips;

	private Image img;

	private bool bigMoment;

	public Button flipButton;

	public GameObject coinFallPanel;

	public GameObject explosion;

	public GameObject destroyedCoin;

	private Gar gar;

	public GameObject gooJobSticker;

	private AudioSource audioSource;

	public AudioClip[] flipSounds;

	public AudioClip[] landingSounds;

	public AudioClip[] headsSounds;

	public AudioClip finalFlipSound;

	public AudioClip explosionNoise;

	public AudioClip fallRollNoise;

	public GameObject prf_sfx;

	public MetaManager metaManager;

	public bool flippedThisSession;

	public CoinSprites[] coinColors;

	public TutorialMessage[] tutorialMessages;

	private float timeSinceMoved = 1f;

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		flipBasePosition = ((Component)this).GetComponent<RectTransform>().anchoredPosition;
		messageManager = Object.FindObjectOfType<MessageManager>();
		playerMoney = Object.FindObjectOfType<PlayerMoney>();
		panelManager = Object.FindObjectOfType<PanelManager>();
		img = ((Component)this).GetComponent<Image>();
		gar = Object.FindObjectOfType<Gar>();
		audioSource = ((Component)this).GetComponent<AudioSource>();
	}

	public void DoFlip()
	{
		if (!isFlipping)
		{
			((MonoBehaviour)this).StartCoroutine(Flip());
		}
	}

	public void SetCoinType(int coinType)
	{
		currentCoin = coinType;
		img.sprite = coinColors[currentCoin].coinHappy;
	}

	public int GetHeadsStreak()
	{
		return headsComboNum;
	}

	public void SetHeadsStreak(int inStreak)
	{
		headsComboNum = inStreak;
	}

	private IEnumerator Flip()
	{
		flippedThisSession = true;
		numFlips++;
		img.sprite = coinColors[currentCoin].coinSmirk;
		isFlipping = true;
		currentFlipDuration = 0f;
		currentFlipAnimateDuration = flipAnimateDuration;
		audioSource.volume = 1f;
		for (int i = 0; i < tutorialMessages.Length; i++)
		{
			if (tutorialMessages[i].flipnum == numFlips)
			{
				messageManager.ShowMessage("<color=#bbffbb>" + tutorialMessages[i].message + "</color>");
			}
		}
		AnchoredPositionTween val = new AnchoredPositionTween();
		((Tween<RectTransform, Vector2>)val).from = Nullable<Vector2>.op_Implicit(((Component)this).GetComponent<RectTransform>().anchoredPosition);
		((Tween<RectTransform, Vector2>)val).to = Nullable<Vector2>.op_Implicit(flipTarget);
		((Tween)val).duration = flipDuration / 2f;
		((Tween)val).delay = 0f;
		((Tween)val).easeType = (EaseType)21;
		AnchoredPositionTween val2 = val;
		AnchoredPositionTween val3 = new AnchoredPositionTween();
		((Tween<RectTransform, Vector2>)val3).from = Nullable<Vector2>.op_Implicit(flipTarget);
		((Tween<RectTransform, Vector2>)val3).to = Nullable<Vector2>.op_Implicit(flipBasePosition);
		((Tween)val3).duration = flipDuration / 2f;
		((Tween)val3).delay = flipDuration / 2f;
		((Tween)val3).easeType = (EaseType)30;
		AnchoredPositionTween val4 = val3;
		TweenExtension.AddTween<RectTransform, Vector2>(((Component)this).gameObject, (Tween<RectTransform, Vector2>)(object)val2);
		TweenExtension.AddTween<RectTransform, Vector2>(((Component)this).gameObject, (Tween<RectTransform, Vector2>)(object)val4);
		float flipTurnMultiplier2 = Random.Range(3, 6);
		bool heads = Random.Range(0f, 1f) < flipHeadsChance;
		if (heads != prevWasHeads)
		{
			flipTurnMultiplier2 += 0.5f;
		}
		bool comboFailed = false;
		if (headsComboNum == 9)
		{
			audioSource.clip = finalFlipSound;
		}
		else
		{
			audioSource.clip = flipSounds[Random.Range(0, flipSounds.Length)];
		}
		audioSource.Play();
		if (heads)
		{
			headsComboNum++;
		}
		else
		{
			if (headsComboNum > 2)
			{
				comboFailed = true;
			}
			headsComboNum = 0;
		}
		if (heads && headsComboNum == 10)
		{
			panelManager.SetPanelArrangement(4);
			((Behaviour)flipButton).enabled = false;
			metaManager.WipeGame();
			float num = Random.Range(0f, 1f);
			int coinsprite3;
			if (num < 0.2f)
			{
				while (currentFlipDuration < flipDuration)
				{
					currentFlipDuration += Time.deltaTime;
					currentFlipAnimateDuration += Time.deltaTime * 360f / flipDuration * flipTurnMultiplier2 + 0.25f;
					((Component)this).transform.eulerAngles = new Vector3(0f, 0f, currentFlipAnimateDuration);
					yield return null;
				}
				((Component)this).transform.eulerAngles = Vector3.zero;
				coinsprite3 = 0;
				Object.FindObjectOfType<Shadow>().GoSideways();
				currentFlipDuration = 0f;
				AnchoredPositionTween val5 = new AnchoredPositionTween();
				((Tween<RectTransform, Vector2>)val5).from = Nullable<Vector2>.op_Implicit(flipBasePosition);
				((Tween<RectTransform, Vector2>)val5).to = Nullable<Vector2>.op_Implicit(new Vector2(0f, -70f));
				((Tween)val5).duration = 1.2f;
				((Tween)val5).delay = 0f;
				((Tween)val5).easeType = (EaseType)21;
				AnchoredPositionTween val6 = val5;
				TweenExtension.AddTween<RectTransform, Vector2>(((Component)this).gameObject, (Tween<RectTransform, Vector2>)(object)val6);
				AnchoredPositionTween val7 = new AnchoredPositionTween();
				((Tween<RectTransform, Vector2>)val7).from = Nullable<Vector2>.op_Implicit(new Vector2(0f, -70f));
				((Tween<RectTransform, Vector2>)val7).to = Nullable<Vector2>.op_Implicit(new Vector2(0f, -600f));
				((Tween)val7).duration = 1f;
				((Tween)val7).delay = 1.2f;
				((Tween)val7).easeType = (EaseType)20;
				AnchoredPositionTween val8 = val7;
				TweenExtension.AddTween<RectTransform, Vector2>(((Component)this).gameObject, (Tween<RectTransform, Vector2>)(object)val8);
				LocalScaleTween val9 = new LocalScaleTween();
				((Tween<Transform, Vector3>)val9).from = Nullable<Vector3>.op_Implicit(((Component)this).transform.localScale);
				((Tween<Transform, Vector3>)val9).to = Nullable<Vector3>.op_Implicit(((Component)this).transform.localScale * 0.6f);
				((Tween)val9).duration = 1.2f;
				((Tween)val9).delay = 0f;
				((Tween)val9).easeType = (EaseType)21;
				LocalScaleTween val10 = val9;
				TweenExtension.AddTween<Transform, Vector3>(((Component)this).gameObject, (Tween<Transform, Vector3>)(object)val10);
				TweenExtension.AddTween<Transform, Vector3>(((Component)Object.FindObjectOfType<Shadow>()).gameObject, (Tween<Transform, Vector3>)(object)val10);
				audioSource.clip = fallRollNoise;
				audioSource.Play();
				while (currentFlipDuration < 2.2f)
				{
					coinsprite3++;
					if (coinsprite3 >= coinColors[currentCoin].coinRollAway.Length)
					{
						coinsprite3 = 0;
					}
					img.sprite = coinColors[currentCoin].coinRollAway[coinsprite3];
					currentFlipDuration += 0.1f;
					yield return (object)new WaitForSeconds(0.1f);
					if (currentFlipDuration > 1.2f)
					{
						((Component)this).transform.parent = coinFallPanel.transform;
						((Component)Object.FindObjectOfType<Shadow>()).transform.parent = coinFallPanel.transform;
						((Component)this).transform.SetAsLastSibling();
					}
				}
				yield return (object)new WaitForSeconds(2.5f);
				gar.LookAtPlayer();
				UnlockCheevo("ENDING_ROLL");
				yield return (object)new WaitForSeconds(3f);
				panelManager.SetPanelArrangement(5);
				yield break;
			}
			if (num < 0.4f)
			{
				while (currentFlipDuration < flipDuration)
				{
					currentFlipDuration += Time.deltaTime;
					currentFlipAnimateDuration += Time.deltaTime * 360f / flipDuration * flipTurnMultiplier2 + 0.25f;
					((Component)this).transform.eulerAngles = new Vector3(0f, 0f, currentFlipAnimateDuration);
					yield return null;
				}
				((Component)this).transform.eulerAngles = Vector3.zero;
				TweenExtension.CancelTweens(((Component)this).gameObject, false);
				((Component)this).GetComponent<RectTransform>().anchoredPosition = flipBasePosition + new Vector2(0f, 100f);
				img.sprite = coinColors[currentCoin].coinSide;
				yield return (object)new WaitForSeconds(0.5f);
				for (coinsprite3 = 0; coinsprite3 < coinColors[currentCoin].coinEggbug.Length; coinsprite3++)
				{
					img.sprite = coinColors[currentCoin].coinEggbug[coinsprite3];
					yield return (object)new WaitForSeconds(0.1f);
				}
				yield return (object)new WaitForSeconds(1.5f);
				AnchoredPositionTween val11 = new AnchoredPositionTween();
				((Tween<RectTransform, Vector2>)val11).from = Nullable<Vector2>.op_Implicit(flipBasePosition + new Vector2(0f, 100f));
				((Tween<RectTransform, Vector2>)val11).to = Nullable<Vector2>.op_Implicit(flipBasePosition + new Vector2(-1200f, 100f));
				((Tween)val11).duration = 4f;
				((Tween)val11).delay = 0f;
				((Tween)val11).easeType = (EaseType)20;
				AnchoredPositionTween val12 = val11;
				EulerAnglesZTween val13 = new EulerAnglesZTween();
				((Tween<Transform, float>)val13).from = Nullable<float>.op_Implicit(0f);
				((Tween<Transform, float>)val13).to = Nullable<float>.op_Implicit(1000f);
				((Tween)val13).duration = 4f;
				((Tween)val13).delay = 0f;
				((Tween)val13).easeType = (EaseType)20;
				EulerAnglesZTween val14 = val13;
				TweenExtension.AddTween<RectTransform, Vector2>(((Component)this).gameObject, (Tween<RectTransform, Vector2>)(object)val12);
				TweenExtension.AddTween<Transform, float>(((Component)this).gameObject, (Tween<Transform, float>)(object)val14);
				yield return (object)new WaitForSeconds(6f);
				gar.LookAtPlayer();
				UnlockCheevo("ENDING_EGGBUG");
				yield return (object)new WaitForSeconds(3f);
				panelManager.SetPanelArrangement(5);
				yield break;
			}
			if (num < 0.6f)
			{
				TweenExtension.CancelTweens(((Component)this).gameObject, false);
				AnchoredPositionTween val15 = new AnchoredPositionTween();
				((Tween<RectTransform, Vector2>)val15).from = Nullable<Vector2>.op_Implicit(flipBasePosition);
				((Tween<RectTransform, Vector2>)val15).to = Nullable<Vector2>.op_Implicit(new Vector2(0f, 1500f));
				((Tween)val15).duration = 0.5f;
				((Tween)val15).delay = 0f;
				((Tween)val15).easeType = (EaseType)21;
				AnchoredPositionTween val16 = val15;
				TweenExtension.AddTween<RectTransform, Vector2>(((Component)this).gameObject, (Tween<RectTransform, Vector2>)(object)val16);
				flipTurnMultiplier2 /= 2f;
				while (currentFlipDuration < 0.5f)
				{
					currentFlipDuration += Time.deltaTime;
					currentFlipAnimateDuration += Time.deltaTime * 360f / flipDuration * flipTurnMultiplier2 + 0.25f;
					((Component)this).transform.eulerAngles = new Vector3(0f, 0f, currentFlipAnimateDuration);
					yield return null;
				}
				gar.LookUp();
				yield return (object)new WaitForSeconds(6f);
				gar.LookAtPlayer();
				UnlockCheevo("ENDING_UP");
				yield return (object)new WaitForSeconds(3f);
				panelManager.SetPanelArrangement(5);
				yield break;
			}
			if (num < 0.9f)
			{
				while (currentFlipDuration < flipDuration)
				{
					currentFlipDuration += Time.deltaTime;
					currentFlipAnimateDuration += Time.deltaTime * 360f / flipDuration * flipTurnMultiplier2;
					((Component)this).transform.eulerAngles = new Vector3(0f, 0f, currentFlipAnimateDuration);
					yield return null;
				}
				((Behaviour)img).enabled = false;
				audioSource.clip = explosionNoise;
				audioSource.Play();
				explosion.SetActive(true);
				destroyedCoin.GetComponent<Image>().sprite = coinColors[currentCoin].coinExplosion;
				destroyedCoin.SetActive(true);
				yield return (object)new WaitForSeconds(3f);
				gar.LookAtPlayer();
				UnlockCheevo("ENDING_BOOM");
				yield return (object)new WaitForSeconds(3f);
				panelManager.SetPanelArrangement(5);
				yield break;
			}
			TweenExtension.CancelTweens(((Component)this).gameObject, false);
			AnchoredPositionTween val17 = new AnchoredPositionTween();
			((Tween<RectTransform, Vector2>)val17).from = Nullable<Vector2>.op_Implicit(flipBasePosition);
			((Tween<RectTransform, Vector2>)val17).to = Nullable<Vector2>.op_Implicit(flipTarget);
			((Tween)val17).duration = 3f;
			((Tween)val17).delay = 0f;
			((Tween)val17).easeType = (EaseType)21;
			AnchoredPositionTween val18 = val17;
			AnchoredPositionTween val19 = new AnchoredPositionTween();
			((Tween<RectTransform, Vector2>)val19).from = Nullable<Vector2>.op_Implicit(flipTarget);
			((Tween<RectTransform, Vector2>)val19).to = Nullable<Vector2>.op_Implicit(flipBasePosition);
			((Tween)val19).duration = 3f;
			((Tween)val19).delay = 3f;
			((Tween)val19).easeType = (EaseType)30;
			AnchoredPositionTween val20 = val19;
			TweenExtension.AddTween<RectTransform, Vector2>(((Component)this).gameObject, (Tween<RectTransform, Vector2>)(object)val18);
			TweenExtension.AddTween<RectTransform, Vector2>(((Component)this).gameObject, (Tween<RectTransform, Vector2>)(object)val20);
			coinsprite3 = 0;
			int totalFlips = 3;
			int numFancyFlips = 1;
			while (currentFlipDuration < 6f)
			{
				img.sprite = coinColors[currentCoin].coinSlowFlip[coinsprite3];
				coinsprite3++;
				if (coinsprite3 >= coinColors[currentCoin].coinSlowFlip.Length)
				{
					if (numFancyFlips < totalFlips)
					{
						coinsprite3 = 0;
						numFancyFlips++;
					}
					else
					{
						coinsprite3 = coinColors[currentCoin].coinSlowFlip.Length - 1;
					}
				}
				float num2 = 6f / (float)(totalFlips * coinColors[currentCoin].coinSlowFlip.Length);
				currentFlipDuration += num2;
				yield return (object)new WaitForSeconds(num2);
			}
			audioSource.clip = headsSounds[9];
			audioSource.Play();
			Object.FindObjectOfType<FlipResultMessage>().ShowResult(heads: true, 0L, 10);
			yield return (object)new WaitForSeconds(1f);
			RocketSpawner[] array = Object.FindObjectsOfType<RocketSpawner>();
			array[0].SpawnRockets(0f);
			array[1].SpawnRockets(1f);
			yield return (object)new WaitForSeconds(4f);
			LocalScaleTween val21 = new LocalScaleTween();
			((Tween<Transform, Vector3>)val21).from = Nullable<Vector3>.op_Implicit(Vector3.zero);
			((Tween<Transform, Vector3>)val21).to = Nullable<Vector3>.op_Implicit(Vector3.one);
			((Tween)val21).duration = 5f;
			((Tween)val21).easeType = (EaseType)0;
			LocalScaleTween val22 = val21;
			TweenExtension.AddTween<Transform, Vector3>(gooJobSticker, (Tween<Transform, Vector3>)(object)val22);
			gooJobSticker.SetActive(true);
			yield return (object)new WaitForSeconds(8f);
			gar.LookAtPlayer();
			UnlockCheevo("ENDING_10FLIP");
			yield return (object)new WaitForSeconds(3f);
			panelManager.SetPanelArrangement(5);
			yield break;
		}
		while (currentFlipDuration < flipDuration)
		{
			currentFlipDuration += Time.deltaTime;
			currentFlipAnimateDuration += Time.deltaTime * 360f / flipDuration * flipTurnMultiplier2;
			((Component)this).transform.eulerAngles = new Vector3(0f, 0f, currentFlipAnimateDuration);
			yield return null;
		}
		((Component)this).transform.eulerAngles = new Vector3(0f, 0f, 0f);
		long num3 = baseFlipWorthInCents * Mathf.CeilToInt(Mathf.Pow(flipComboMultiplier, (float)(headsComboNum - 1)));
		if (heads)
		{
			string text = "HEADS";
			for (int j = 1; j < headsComboNum; j++)
			{
				text += "!";
			}
			messageManager.ShowMessage(text);
			img.sprite = coinColors[currentCoin].coinHappy;
			playerMoney.moneyInCents += num3;
			UnlockCheevo(headsComboNum + "FLIP");
			GameObject obj = Object.Instantiate<GameObject>(prf_sfx);
			obj.GetComponent<AudioSource>().clip = headsSounds[headsComboNum - 1];
			obj.GetComponent<AudioSource>().Play();
			Object.Destroy((Object)(object)obj, 3f);
		}
		else
		{
			string text2 = "<color=#FFFFFF77>TAILS";
			if (comboFailed)
			{
				text2 += "...";
			}
			text2 += "</color>";
			messageManager.ShowMessage(text2);
			img.sprite = coinColors[currentCoin].coinSad;
			audioSource.clip = landingSounds[Random.Range(0, landingSounds.Length)];
			audioSource.volume = 0.5f;
			audioSource.Play();
		}
		Object.FindObjectOfType<FlipResultMessage>().ShowResult(heads, num3, headsComboNum);
		if (numFlips > 2 && panelManager.GetCurrentArrangement() < 1)
		{
			panelManager.SetPanelArrangement(1);
		}
		if ((numFlips >= 8 || (bigMoment && comboFailed)) && (panelManager.GetCurrentArrangement() < 2 || (bigMoment && comboFailed)))
		{
			panelManager.SetPanelArrangement(2);
			if (bigMoment && comboFailed)
			{
				timeSinceMoved = 0f;
			}
			bigMoment = false;
		}
		if (headsComboNum == 9)
		{
			bigMoment = true;
			panelManager.SetPanelArrangement(3);
			timeSinceMoved = 0f;
		}
		prevWasHeads = heads;
		isFlipping = false;
		metaManager.SaveGame();
	}

	private void UnlockCheevo(string cheevoName)
	{
		if (SteamManager.Initialized)
		{
			SteamUserStats.SetAchievement(cheevoName);
			SteamUserStats.StoreStats();
		}
	}

	public int GetNumFlips()
	{
		return numFlips;
	}

	public void SetNumFlips(int inFlips)
	{
		numFlips = inFlips;
	}

	private void Update()
	{
		timeSinceMoved += Time.deltaTime;
		if (Input.GetKeyDown((KeyCode)32) && timeSinceMoved > 1f)
		{
			DoFlip();
		}
	}
}
public class Firework : MonoBehaviour
{
	public GameObject prf_explosion;

	private void Start()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Expected O, but got Unknown
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Expected O, but got Unknown
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Expected O, but got Unknown
		AnchoredPositionTween val = new AnchoredPositionTween();
		((Tween<RectTransform, Vector2>)val).from = Nullable<Vector2>.op_Implicit(new Vector2(0f, 0f));
		((Tween<RectTransform, Vector2>)val).to = Nullable<Vector2>.op_Implicit(new Vector2(0f, 500f));
		((Tween)val).duration = 1f;
		((Tween)val).easeType = (EaseType)20;
		AnchoredPositionTween val2 = val;
		TweenExtension.AddTween<RectTransform, Vector2>(((Component)this).gameObject, (Tween<RectTransform, Vector2>)(object)val2);
		((MonoBehaviour)this).Invoke("Explode", 1f);
	}

	private void Explode()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		GameObject obj = Object.Instantiate<GameObject>(prf_explosion, ((Component)this).transform.parent);
		obj.GetComponent<RectTransform>().anchoredPosition = ((Component)this).GetComponent<RectTransform>().anchoredPosition;
		Object.Destroy((Object)(object)obj, 2f);
		Object.Destroy((Object)(object)((Component)this).gameObject, 0.01f);
	}

	private void Update()
	{
	}
}
public class FlipResultMessage : MonoBehaviour
{
	private TMP_Text text;

	private float baseYPos;

	private void Start()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		text = ((Component)this).GetComponent<TMP_Text>();
		baseYPos = ((Component)this).GetComponent<RectTransform>().anchoredPosition.y;
		text.text = "";
	}

	public void ShowResult(bool heads, long money, int comboNum)
	{
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Expected O, but got Unknown
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Expected O, but got Unknown
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: 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_00a6: Expected O, but got Unknown
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Expected O, but got Unknown
		//IL_00c8: 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_00ec: Expected O, but got Unknown
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Expected O, but got Unknown
		//IL_0111: Expected O, but got Unknown
		TweenExtension.CancelTweens(((Component)this).gameObject, false);
		if (heads)
		{
			text.text = "HEADS " + comboNum + "X\n" + ((money > 0) ? Mathy.CentsToDollarString(money) : "");
		}
		else
		{
			text.text = "TAILS";
		}
		((Graphic)text).color = Color.white;
		AnchoredPositionYTween val = new AnchoredPositionYTween();
		((Tween<RectTransform, float>)val).from = Nullable<float>.op_Implicit(baseYPos);
		((Tween<RectTransform, float>)val).to = Nullable<float>.op_Implicit(baseYPos + 150f);
		((Tween)val).duration = 1f;
		((Tween)val).easeType = (EaseType)41;
		AnchoredPositionYTween val2 = val;
		TweenExtension.AddTween<RectTransform, float>(((Component)this).gameObject, (Tween<RectTransform, float>)(object)val2);
		ColorTween val3 = new ColorTween();
		((Tween<Transform, Color>)val3).from = Nullable<Color>.op_Implicit(Color.white);
		((Tween<Transform, Color>)val3).to = Nullable<Color>.op_Implicit(new Color(1f, 1f, 1f, 0f));
		((Tween)val3).duration = 1f;
		((Tween)val3).easeType = (EaseType)0;
		((Tween<Transform, Color>)val3).onUpdate = delegate(TweenInstance<Transform, Color> _, Color value)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			((Graphic)text).color = value;
		};
		ColorTween val4 = val3;
		TweenExtension.AddTween<Transform, Color>(((Component)this).gameObject, (Tween<Transform, Color>)(object)val4);
	}

	private void Update()
	{
	}
}
public class Gar : MonoBehaviour
{
	private Image img;

	public Sprite baseSprite;

	public Sprite drink1;

	public Sprite drink2;

	public Sprite lookUp;

	public Sprite lookAtPlayer;

	private bool ableToDrink = true;

	private void Start()
	{
		img = ((Component)this).GetComponent<Image>();
		((MonoBehaviour)this).StartCoroutine(Drink());
	}

	private IEnumerator Drink()
	{
		while (true)
		{
			if (ableToDrink)
			{
				yield return (object)new WaitForSeconds(Random.Range(30f, 60f));
				if (ableToDrink)
				{
					img.sprite = drink1;
				}
				yield return (object)new WaitForSeconds(1f);
				if (ableToDrink)
				{
					img.sprite = drink2;
				}
				yield return (object)new WaitForSeconds(Random.Range(2f, 5f));
				if (ableToDrink)
				{
					img.sprite = drink1;
				}
				yield return (object)new WaitForSeconds(1f);
				if (ableToDrink)
				{
					img.sprite = baseSprite;
				}
			}
			yield return null;
		}
	}

	public void LookAtPlayer()
	{
		ableToDrink = false;
		img.sprite = lookAtPlayer;
	}

	public void LookUp()
	{
		ableToDrink = false;
		img.sprite = lookUp;
	}

	private void Update()
	{
	}
}
public class GenericMessage : MonoBehaviour
{
	private Vector2 targetPos;

	private RectTransform rect;

	private Color targetColor;

	private TMP_Text text;

	private void Start()
	{
		rect = ((Component)this).GetComponent<RectTransform>();
		text = ((Component)this).GetComponent<TMP_Text>();
	}

	public void SetMessage(string message)
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		text = ((Component)this).GetComponent<TMP_Text>();
		text.text = message + "\n----";
		((Graphic)text).color = new Color(1f, 1f, 1f, 0f);
	}

	public string GetMessage()
	{
		return text.text.Trim('-').Trim('\n');
	}

	public void SetPosition(int position)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: 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_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: 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)
		rect = ((Component)this).GetComponent<RectTransform>();
		float num = position;
		Rect val = rect.rect;
		targetPos = new Vector2(0f, num * ((Rect)(ref val)).height);
		if (position == 1)
		{
			RectTransform obj = rect;
			Vector2 val2 = targetPos;
			val = rect.rect;
			obj.anchoredPosition = val2 + new Vector2(0f, 0f - ((Rect)(ref val)).height);
		}
		if (position > 8)
		{
			targetColor = new Color(1f, 1f, 1f, 1f - (float)position / 11f);
		}
		else
		{
			targetColor = Color.white;
		}
		_ = 11;
	}

	private void Update()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		rect.anchoredPosition = Mathy.Decay(rect.anchoredPosition, targetPos, 8f, Time.deltaTime);
		((Graphic)text).color = Mathy.Decay(((Graphic)text).color, targetColor, 8f, Time.deltaTime);
	}
}
public class HeadsChanceCounter : MonoBehaviour
{
	private TMP_Text text;

	private CoinFlip flip;

	private void Start()
	{
		text = ((Component)this).GetComponent<TMP_Text>();
		flip = Object.FindObjectOfType<CoinFlip>();
	}

	private void Update()
	{
		text.text = "HEADS CHANCE: " + (int)(flip.flipHeadsChance * 100f) + "%";
	}
}
public class LogoFade : MonoBehaviour
{
	private Image img;

	private CoinFlip coin;

	public bool flipsReq;

	private void Start()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		img = ((Component)this).GetComponent<Image>();
		coin = Object.FindObjectOfType<CoinFlip>();
		((Graphic)img).color = new Color(((Graphic)img).color.r, ((Graphic)img).color.g, ((Graphic)img).color.b, 1f);
	}

	private void Update()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		if (coin.flippedThisSession || flipsReq)
		{
			((Graphic)img).color = Mathy.Decay(((Graphic)img).color, new Color(((Graphic)img).color.r, ((Graphic)img).color.g, ((Graphic)img).color.b, 0f), 8f, Time.deltaTime);
			if (((Graphic)img).color.a < 0.05f)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject, 0.2f);
			}
		}
	}
}
public static class Mathy
{
	public static float Decay(float a, float b, float decay, float dt)
	{
		return b + (a - b) * Mathf.Exp((0f - decay) * dt);
	}

	public static Vector3 Decay(Vector3 a, Vector3 b, float decay, float dt)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		return b + (a - b) * Mathf.Exp((0f - decay) * dt);
	}

	public static Vector2 Decay(Vector2 a, Vector2 b, float decay, float dt)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		return b + (a - b) * Mathf.Exp((0f - decay) * dt);
	}

	public static Color Decay(Color a, Color b, float decay, float dt)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		return b + (a - b) * Mathf.Exp((0f - decay) * dt);
	}

	public static float AngleBetween(Vector2 vector1, Vector2 vector2)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		float num = vector1.x * vector2.y - vector2.x * vector1.y;
		float num2 = vector1.x * vector2.x + vector1.y * vector2.y;
		return Mathf.Atan2(num, num2) * (180f / MathF.PI);
	}

	public static string CentsToDollarString(long cents)
	{
		return "$" + cents / 100 + "." + (cents % 100).ToString("D2");
	}

	public static string CentsToDollarString(int cents)
	{
		return "$" + cents / 100 + "." + (cents % 100).ToString("D2");
	}
}
public class MessageManager : MonoBehaviour
{
	public GenericMessage prf_message;

	public List<GenericMessage> messages;

	private void Start()
	{
		messages = new List<GenericMessage>();
	}

	public void ShowMessage(string message)
	{
		GenericMessage genericMessage = Object.Instantiate<GenericMessage>(prf_message, ((Component)this).transform);
		messages.Add(genericMessage);
		genericMessage.SetMessage(message);
		UpdateUI();
	}

	public string[] GetVisibleMessages()
	{
		List<string> list = new List<string>();
		for (int i = 0; i < messages.Count; i++)
		{
			if (!messages[i].GetMessage().Contains("ffbbbb"))
			{
				list.Add(messages[i].GetMessage());
			}
		}
		string[] array = new string[list.Count];
		for (int j = 0; j < array.Length; j++)
		{
			array[j] = list[j];
		}
		return array;
	}

	public void ShowMessagesAtOnce(string[] newMessages)
	{
		for (int i = 0; i < newMessages.Length; i++)
		{
			ShowMessage(newMessages[i]);
		}
	}

	private void UpdateUI()
	{
		for (int i = 0; i < messages.Count; i++)
		{
			messages[i].SetPosition(messages.Count - i);
		}
		if (messages.Count > 13)
		{
			Object.Destroy((Object)(object)((Component)messages[0]).gameObject, 0.01f);
			messages.RemoveAt(0);
		}
	}

	private void Update()
	{
	}
}
public class MetaManager : MonoBehaviour
{
	private string foldername;

	private string filename;

	private string backupFilename;

	private Savegame savegame;

	public ShopButton[] shopButtons;

	private bool gameWiped;

	private void Start()
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		foldername = Application.persistentDataPath;
		if (SteamManager.Initialized)
		{
			string text = foldername;
			CSteamID steamID = SteamUser.GetSteamID();
			foldername = text + "/" + ((object)(CSteamID)(ref steamID)).ToString();
		}
		filename = foldername + "/save.coin";
		backupFilename = foldername + "/save_backup.coin";
		Debug.Log((object)filename);
		if (File.Exists(filename))
		{
			Debug.Log((object)"File found!");
			LoadGame();
		}
		else
		{
			Debug.Log((object)"File not found!");
			CreateNewGame();
		}
	}

	private void CreateNewGame()
	{
		Debug.Log((object)"Creating new game...");
		savegame = new Savegame();
		SaveGame();
	}

	public void WipeGame()
	{
		Debug.Log((object)"WIPING GAME");
		gameWiped = true;
		savegame.headsStreak = 0;
		savegame.flipCount = 0;
		savegame.shopLevels = new int[shopButtons.Length];
		for (int i = 0; i < shopButtons.Length; i++)
		{
			savegame.shopLevels[i] = 0;
		}
		savegame.messages = new string[0];
		savegame.playerMoney = 0L;
		FinishSavingGame();
	}

	public void ResetGame()
	{
		SceneManager.LoadScene("Game");
	}

	public void SaveGame()
	{
		Debug.Log((object)"Starting save...");
		if (!gameWiped)
		{
			CoinFlip coinFlip = Object.FindObjectOfType<CoinFlip>();
			savegame.headsStreak = coinFlip.GetHeadsStreak();
			savegame.flipCount = coinFlip.GetNumFlips();
			savegame.shopLevels = new int[shopButtons.Length];
			for (int i = 0; i < shopButtons.Length; i++)
			{
				savegame.shopLevels[i] = shopButtons[i].GetShopLevel();
			}
			MessageManager messageManager = Object.FindObjectOfType<MessageManager>();
			savegame.messages = messageManager.GetVisibleMessages();
			savegame.playerMoney = Object.FindObjectOfType<PlayerMoney>().moneyInCents;
			FinishSavingGame();
		}
	}

	private void FinishSavingGame()
	{
		Debug.Log((object)"Saving game...");
		Directory.CreateDirectory(foldername);
		Debug.Log((object)"Successfully created directory...");
		Debug.Log((object)"Creating backup...");
		using (StreamWriter streamWriter = File.CreateText(backupFilename))
		{
			Debug.Log((object)"Successfully created file writer...");
			streamWriter.Write(JsonUtility.ToJson((object)savegame));
			Debug.Log((object)"Successfully wrote savegame to file...");
			streamWriter.Close();
			Debug.Log((object)"Successfully closed filewriter...");
		}
		Debug.Log((object)"Creating true save file...");
		using StreamWriter streamWriter2 = File.CreateText(filename);
		Debug.Log((object)"Successfully created file writer...");
		streamWriter2.Write(JsonUtility.ToJson((object)savegame));
		Debug.Log((object)"Successfully wrote savegame to file...");
		streamWriter2.Close();
		Debug.Log((object)"Successfully closed filewriter...");
	}

	private void LoadGame()
	{
		Debug.Log((object)"Loading game...");
		string text = File.ReadAllText(filename);
		try
		{
			savegame = JsonUtility.FromJson<Savegame>(text);
		}
		catch
		{
			Debug.Log((object)"First save file is corrupted!! Trying backup...");
			if (!File.Exists(backupFilename))
			{
				Debug.Log((object)"Backup save file does not exist! Starting new game...");
				CreateNewGame();
				return;
			}
			string text2 = File.ReadAllText(backupFilename);
			try
			{
				savegame = JsonUtility.FromJson<Savegame>(text2);
			}
			catch
			{
				Debug.Log((object)"Backup save file is ALSO corrupted!! Starting new game...");
				CreateNewGame();
				return;
			}
		}
		CoinFlip coinFlip = Object.FindObjectOfType<CoinFlip>();
		coinFlip.SetHeadsStreak(savegame.headsStreak);
		coinFlip.SetNumFlips(savegame.flipCount);
		for (int i = 0; i < savegame.shopLevels.Length; i++)
		{
			shopButtons[i].SetShopLevel(savegame.shopLevels[i]);
		}
		Object.FindObjectOfType<MessageManager>().ShowMessagesAtOnce(savegame.messages);
		Object.FindObjectOfType<PlayerMoney>().moneyInCents = savegame.playerMoney;
		Debug.Log((object)"Game loaded!");
	}

	private void Update()
	{
	}
}
public class MoneyCounter : MonoBehaviour
{
	private PlayerMoney money;

	private TMP_Text text;

	private void Start()
	{
		money = Object.FindObjectOfType<PlayerMoney>();
		text = ((Component)this).GetComponent<TMP_Text>();
	}

	private void Update()
	{
		text.text = Mathy.CentsToDollarString(money.moneyInCents);
	}
}
public class NumFlipsCounter : MonoBehaviour
{
	private TMP_Text text;

	private CoinFlip flip;

	private void Start()
	{
		text = ((Component)this).GetComponent<TMP_Text>();
		flip = Object.FindObjectOfType<CoinFlip>();
	}

	private void Update()
	{
		text.text = "TOTAL FLIPS: " + flip.GetNumFlips();
	}
}
public class PanelManager : MonoBehaviour
{
	[Serializable]
	public struct PanelArrangement
	{
		public float coinPanelX;

		public float messagePanelX;

		public float shopPanelX;

		public float optionsPanelX;

		public float endingPanelX;
	}

	public RectTransform coinPanel;

	public RectTransform messagePanel;

	public RectTransform shopPanel;

	public RectTransform optionsPanel;

	public RectTransform endingPanel;

	private int currentPanelArrangement;

	public PanelArrangement[] panelArrangements;

	private void Start()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		coinPanel.anchoredPosition = new Vector2(panelArrangements[currentPanelArrangement].coinPanelX, 0f);
		messagePanel.anchoredPosition = new Vector2(panelArrangements[currentPanelArrangement].messagePanelX, 0f);
		shopPanel.anchoredPosition = new Vector2(panelArrangements[currentPanelArrangement].shopPanelX, 0f);
		optionsPanel.anchoredPosition = new Vector2(panelArrangements[currentPanelArrangement].optionsPanelX, 0f);
		endingPanel.anchoredPosition = new Vector2(panelArrangements[currentPanelArrangement].endingPanelX, 0f);
	}

	public int GetCurrentArrangement()
	{
		return currentPanelArrangement;
	}

	public void SetPanelArrangement(int newArrangement)
	{
		currentPanelArrangement = newArrangement;
	}

	private void Update()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: 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_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: 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_014f: Unknown result type (might be due to invalid IL or missing references)
		coinPanel.anchoredPosition = Mathy.Decay(coinPanel.anchoredPosition, new Vector2(panelArrangements[currentPanelArrangement].coinPanelX, 0f), 4f, Time.deltaTime);
		messagePanel.anchoredPosition = Mathy.Decay(messagePanel.anchoredPosition, new Vector2(panelArrangements[currentPanelArrangement].messagePanelX, 0f), 4f, Time.deltaTime);
		shopPanel.anchoredPosition = Mathy.Decay(shopPanel.anchoredPosition, new Vector2(panelArrangements[currentPanelArrangement].shopPanelX, 0f), 4f, Time.deltaTime);
		optionsPanel.anchoredPosition = Mathy.Decay(optionsPanel.anchoredPosition, new Vector2(panelArrangements[currentPanelArrangement].optionsPanelX, 0f), 4f, Time.deltaTime);
		endingPanel.anchoredPosition = Mathy.Decay(endingPanel.anchoredPosition, new Vector2(panelArrangements[currentPanelArrangement].endingPanelX, 0f), 4f, Time.deltaTime);
	}
}
public class PlayerMoney : MonoBehaviour
{
	public long moneyInCents;

	private void Start()
	{
	}

	private void Update()
	{
	}
}
public class QuitButton : MonoBehaviour
{
	private bool quitPrimed;

	private MetaManager metaManager;

	private int escPrime;

	private void Start()
	{
		metaManager = Object.FindObjectOfType<MetaManager>();
	}

	public void UnprimeQuit()
	{
		quitPrimed = false;
		escPrime = 0;
	}

	public void Click()
	{
		if ((Object)(object)Object.FindObjectOfType<PanelManager>() != (Object)null && Object.FindObjectOfType<PanelManager>().GetCurrentArrangement() == 0)
		{
			Object.FindObjectOfType<PanelManager>().SetPanelArrangement(1);
		}
		if (!quitPrimed)
		{
			Object.FindObjectOfType<MessageManager>().ShowMessage("<color=#ffbbbb>CLICK AGAIN TO QUIT GAME. PROGRESS IS SAVED AUTOMATICALLY</color>");
			quitPrimed = true;
			metaManager.SaveGame();
		}
		else
		{
			metaManager.SaveGame();
			Application.Quit();
		}
	}

	private void Update()
	{
		if (Input.GetKeyDown((KeyCode)27))
		{
			if ((Object)(object)Object.FindObjectOfType<PanelManager>() != (Object)null && Object.FindObjectOfType<PanelManager>().GetCurrentArrangement() == 0)
			{
				Object.FindObjectOfType<PanelManager>().SetPanelArrangement(1);
			}
			escPrime++;
			switch (escPrime)
			{
			case 1:
				Object.FindObjectOfType<MessageManager>().ShowMessage("<color=#ffbbbb>RAPIDLY PRESS ESCAPE 3X MORE TO RESET GAME.</color>");
				break;
			case 2:
				Object.FindObjectOfType<MessageManager>().ShowMessage("<color=#ffbbbb>RAPIDLY PRESS ESCAPE 2X MORE TO RESET GAME.</color>");
				break;
			case 3:
				Object.FindObjectOfType<MessageManager>().ShowMessage("<color=#ffbbbb>RAPIDLY PRESS ESCAPE 1X MORE TO RESET GAME.</color>");
				break;
			case 4:
				metaManager.WipeGame();
				metaManager.ResetGame();
				break;
			}
		}
		if (Input.GetKeyDown((KeyCode)32))
		{
			escPrime = 0;
		}
	}
}
public class RocketSpawner : MonoBehaviour
{
	public GameObject prf_rocket;

	private void Start()
	{
	}

	public void SpawnRockets(float delay)
	{
		((MonoBehaviour)this).InvokeRepeating("FireRocket", delay, 2.5f);
	}

	public void FireRocket()
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		Object.Instantiate<GameObject>(prf_rocket, new Vector3(0f, -30000f), Quaternion.identity, ((Component)this).transform);
	}

	private void Update()
	{
	}
}
public class Savegame
{
	public string[] messages;

	public int[] shopLevels;

	public int headsStreak;

	public int flipCount;

	public long playerMoney;
}
public class Shadow : MonoBehaviour
{
	public CoinFlip coin;

	private RectTransform coinRect;

	private RectTransform rect;

	private bool yLocked = true;

	public Sprite goSideways;

	private void Start()
	{
		coinRect = ((Component)coin).GetComponent<RectTransform>();
		rect = ((Component)this).GetComponent<RectTransform>();
	}

	public void GoSideways()
	{
		((Component)this).GetComponent<Image>().sprite = goSideways;
		yLocked = false;
	}

	private void Update()
	{
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: 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_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: 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_008d: Unknown result type (might be due to invalid IL or missing references)
		if (yLocked)
		{
			float num = coinRect.anchoredPosition.y - rect.anchoredPosition.y;
			float num2 = Mathf.InverseLerp(20f, 1600f, num);
			num2 = 1f - num2;
			((Component)this).transform.localScale = ((Component)coin).transform.localScale * num2;
			rect.anchoredPosition = new Vector2(coinRect.anchoredPosition.x, rect.anchoredPosition.y);
		}
		else
		{
			rect.anchoredPosition = coinRect.anchoredPosition + new Vector2(0f, -10f);
		}
	}
}
public class ShopButton : MonoBehaviour
{
	public enum UpgradeType
	{
		HeadsChance,
		FlipTime,
		FlipMultiplier,
		FlipBaseWorth
	}

	private TMP_Text text;

	private Button button;

	private MessageManager messageManager;

	private PlayerMoney money;

	public string purchaseText;

	public long[] costs;

	public string allOutText;

	private int upgradeLevel;

	private long currentCost;

	public UpgradeType upgradeType;

	private bool hidingMessage;

	private void Start()
	{
		text = ((Component)this).GetComponentInChildren<TMP_Text>();
		money = Object.FindObjectOfType<PlayerMoney>();
		button = ((Component)this).GetComponent<Button>();
		messageManager = Object.FindObjectOfType<MessageManager>();
	}

	public void Buy()
	{
		money.moneyInCents -= costs[upgradeLevel];
		upgradeLevel++;
	}

	public int GetShopLevel()
	{
		return upgradeLevel;
	}

	public void SetShopLevel(int level)
	{
		hidingMessage = true;
		upgradeLevel = level;
		for (int i = 0; i < Mathf.Min(upgradeLevel, costs.Length); i++)
		{
			switch (upgradeType)
			{
			case UpgradeType.HeadsChance:
				IncreaseHeadsChance(0.05f);
				break;
			case UpgradeType.FlipTime:
				DecreaseFlipTime(0.2f);
				break;
			case UpgradeType.FlipMultiplier:
				IncreaseFlipMultiplier(0.5f);
				break;
			case UpgradeType.FlipBaseWorth:
				IncreaseFlipBaseWorth();
				break;
			}
		}
		hidingMessage = false;
	}

	public void IncreaseHeadsChance(float amount)
	{
		Object.FindObjectOfType<CoinFlip>().flipHeadsChance += amount;
		if (!hidingMessage)
		{
			messageManager.ShowMessage("<color=#bbbbff>HEADS CHANCE IS NOW " + (int)(Object.FindObjectOfType<CoinFlip>().flipHeadsChance * 100f) + "%</color>");
		}
	}

	public void DecreaseFlipTime(float amount)
	{
		Object.FindObjectOfType<CoinFlip>().flipDuration -= amount;
		if (!hidingMessage)
		{
			messageManager.ShowMessage("<color=#bbbbff>FLIP DURATION IS NOW " + Object.FindObjectOfType<CoinFlip>().flipDuration + " SECONDS</color>");
		}
	}

	public void IncreaseFlipMultiplier(float amount)
	{
		Object.FindObjectOfType<CoinFlip>().flipComboMultiplier += amount;
		if (!hidingMessage)
		{
			messageManager.ShowMessage("<color=#bbbbff>HEADS COMBO MULTIPLIER IS NOW " + Object.FindObjectOfType<CoinFlip>().flipComboMultiplier + "X PER HEADS IN A ROW</color>");
		}
	}

	public void IncreaseFlipBaseWorth()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: 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)
		int baseFlipWorthInCents = 0;
		Color white = Color.white;
		Vector3 localScale = Vector3.one;
		int coinType = 0;
		switch (upgradeLevel)
		{
		case 1:
			baseFlipWorthInCents = 5;
			((Color)(ref white))..ctor(0.9f, 0.9f, 0.9f, 1f);
			coinType = 1;
			if (!hidingMessage)
			{
				messageManager.ShowMessage("<color=#bbbbff>COIN IS NOW WORTH $0.05</color>");
			}
			break;
		case 2:
			baseFlipWorthInCents = 10;
			((Color)(ref white))..ctor(1f, 1f, 1f, 1f);
			localScale = Vector3.one * 0.7f;
			coinType = 1;
			if (!hidingMessage)
			{
				messageManager.ShowMessage("<color=#bbbbff>COIN IS NOW WORTH $0.10</color>");
			}
			break;
		case 3:
			baseFlipWorthInCents = 25;
			localScale = Vector3.one * 1.2f;
			coinType = 1;
			if (!hidingMessage)
			{
				messageManager.ShowMessage("<color=#bbbbff>COIN IS NOW WORTH $0.25</color>");
			}
			break;
		case 4:
			baseFlipWorthInCents = 100;
			localScale = Vector3.one * 1.2f;
			coinType = 2;
			if (!hidingMessage)
			{
				messageManager.ShowMessage("<color=#bbbbff>COIN IS NOW WORTH $1.00</color>");
			}
			break;
		}
		Object.FindObjectOfType<CoinFlip>().baseFlipWorthInCents = baseFlipWorthInCents;
		((Graphic)((Component)Object.FindObjectOfType<CoinFlip>()).GetComponent<Image>()).color = white;
		((Component)Object.FindObjectOfType<CoinFlip>()).transform.localScale = localScale;
		Object.FindObjectOfType<CoinFlip>().SetCoinType(coinType);
	}

	private void Update()
	{
		if (upgradeLevel >= costs.Length)
		{
			text.text = allOutText;
			((Selectable)button).interactable = false;
		}
		else
		{
			currentCost = costs[upgradeLevel];
			((Selectable)button).interactable = money.moneyInCents >= currentCost;
			text.text = purchaseText + "\n" + Mathy.CentsToDollarString(currentCost);
		}
	}
}
[DisallowMultipleComponent]
public class SteamManager : MonoBehaviour
{
	protected static bool s_EverInitialized;

	protected static SteamManager s_instance;

	protected bool m_bInitialized;

	protected SteamAPIWarningMessageHook_t m_SteamAPIWarningMessageHook;

	protected static SteamManager Instance
	{
		get
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)s_instance == (Object)null)
			{
				return new GameObject("SteamManager").AddComponent<SteamManager>();
			}
			return s_instance;
		}
	}

	public static bool Initialized => Instance.m_bInitialized;

	[MonoPInvokeCallback(typeof(SteamAPIWarningMessageHook_t))]
	protected static void SteamAPIDebugTextHook(int nSeverity, StringBuilder pchDebugText)
	{
		Debug.LogWarning((object)pchDebugText);
	}

	[RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)]
	private static void InitOnPlayMode()
	{
		s_EverInitialized = false;
		s_instance = null;
	}

	protected virtual void Awake()
	{
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)s_instance != (Object)null)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
			return;
		}
		s_instance = this;
		if (s_EverInitialized)
		{
			throw new Exception("Tried to Initialize the SteamAPI twice in one session!");
		}
		Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		if (!Packsize.Test())
		{
			Debug.LogError((object)"[Steamworks.NET] Packsize Test returned false, the wrong version of Steamworks.NET is being run in this platform.", (Object)(object)this);
		}
		if (!DllCheck.Test())
		{
			Debug.LogError((object)"[Steamworks.NET] DllCheck Test returned false, One or more of the Steamworks binaries seems to be the wrong version.", (Object)(object)this);
		}
		try
		{
			if (SteamAPI.RestartAppIfNecessary(AppId_t.Invalid))
			{
				Debug.Log((object)"[Steamworks.NET] Shutting down because RestartAppIfNecessary returned true. Steam will restart the application.");
				Application.Quit();
				return;
			}
		}
		catch (DllNotFoundException ex)
		{
			Debug.LogError((object)("[Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + ex), (Object)(object)this);
			Application.Quit();
			return;
		}
		m_bInitialized = SteamAPI.Init();
		if (!m_bInitialized)
		{
			Debug.LogError((object)"[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.", (Object)(object)this);
		}
		else
		{
			s_EverInitialized = true;
		}
	}

	protected virtual void OnEnable()
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		if ((Object)(object)s_instance == (Object)null)
		{
			s_instance = this;
		}
		if (m_bInitialized && m_SteamAPIWarningMessageHook == null)
		{
			m_SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook);
			SteamClient.SetWarningMessageHook(m_SteamAPIWarningMessageHook);
		}
	}

	protected virtual void OnDestroy()
	{
		if (!((Object)(object)s_instance != (Object)(object)this))
		{
			s_instance = null;
			if (m_bInitialized)
			{
				SteamAPI.Shutdown();
			}
		}
	}

	protected virtual void Update()
	{
		if (m_bInitialized)
		{
			SteamAPI.RunCallbacks();
		}
	}
}
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
	private struct MonoScriptData
	{
		public byte[] FilePathsData;

		public byte[] TypesData;

		public int TotalTypes;

		public int TotalFiles;

		public bool IsEditorOnly;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private static MonoScriptData Get()
	{
		MonoScriptData result = default(MonoScriptData);
		result.FilePathsData = new byte[808]
		{
			0, 0, 0, 1, 0, 0, 0, 30, 92, 65,
			115, 115, 101, 116, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 65, 117, 100, 105, 111, 66,
			117, 116, 116, 111, 110, 46, 99, 115, 0, 0,
			0, 3, 0, 0, 0, 27, 92, 65, 115, 115,
			101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 67, 111, 105, 110, 70, 108, 105, 112,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			27, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 70, 105, 114,
			101, 119, 111, 114, 107, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 36, 92, 65, 115, 115,
			101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 70, 108, 105, 112, 82, 101, 115, 117,
			108, 116, 77, 101, 115, 115, 97, 103, 101, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 22,
			92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
			114, 105, 112, 116, 115, 92, 71, 97, 114, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 33,
			92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
			114, 105, 112, 116, 115, 92, 71, 101, 110, 101,
			114, 105, 99, 77, 101, 115, 115, 97, 103, 101,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			37, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 72, 101, 97,
			100, 115, 67, 104, 97, 110, 99, 101, 67, 111,
			117, 110, 116, 101, 114, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 27, 92, 65, 115, 115,
			101, 116, 115, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 76, 111, 103, 111, 70, 97, 100, 101,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			24, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 77, 97, 116,
			104, 121, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 33, 92, 65, 115, 115, 101, 116, 115,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 77,
			101, 115, 115, 97, 103, 101, 77, 97, 110, 97,
			103, 101, 114, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 30, 92, 65, 115, 115, 101, 116,
			115, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			77, 101, 116, 97, 77, 97, 110, 97, 103, 101,
			114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 31, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 77, 111,
			110, 101, 121, 67, 111, 117, 110, 116, 101, 114,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			34, 92, 65, 115, 115, 101, 116, 115, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 78, 117, 109,
			70, 108, 105, 112, 115, 67, 111, 117, 110, 116,
			101, 114, 46, 99, 115, 0, 0, 0, 2, 0,
			0, 0, 31, 92, 65, 115, 115, 101, 116, 115,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 80,
			97, 110, 101, 108, 77, 97, 110, 97, 103, 101,
			114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 30, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 80, 108,
			97, 121, 101, 114, 77, 111, 110, 101, 121, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 29,
			92, 65, 115, 115, 101, 116, 115, 92, 83, 99,
			114, 105, 112, 116, 115, 92, 81, 117, 105, 116,
			66, 117, 116, 116, 111, 110, 46, 99, 115, 0,
			0, 0, 1, 0, 0, 0, 32, 92, 65, 115,
			115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 82, 111, 99, 107, 101, 116, 83,
			112, 97, 119, 110, 101, 114, 46, 99, 115, 0,
			0, 0, 1, 0, 0, 0, 27, 92, 65, 115,
			115, 101, 116, 115, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 83, 97, 118, 101, 103, 97, 109,
			101, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 25, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 83, 104,
			97, 100, 111, 119, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 29, 92, 65, 115, 115, 101,
			116, 115, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 83, 104, 111, 112, 66, 117, 116, 116, 111,
			110, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 46, 92, 65, 115, 115, 101, 116, 115, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 83, 116,
			101, 97, 109, 119, 111, 114, 107, 115, 46, 78,
			69, 84, 92, 83, 116, 101, 97, 109, 77, 97,
			110, 97, 103, 101, 114, 46, 99, 115
		};
		result.TypesData = new byte[440]
		{
			0, 0, 0, 0, 12, 124, 65, 117, 100, 105,
			111, 66, 117, 116, 116, 111, 110, 0, 0, 0,
			0, 9, 124, 67, 111, 105, 110, 70, 108, 105,
			112, 0, 0, 0, 0, 20, 67, 111, 105, 110,
			70, 108, 105, 112, 124, 67, 111, 105, 110, 83,
			112, 114, 105, 116, 101, 115, 0, 0, 0, 0,
			24, 67, 111, 105, 110, 70, 108, 105, 112, 124,
			84, 117, 116, 111, 114, 105, 97, 108, 77, 101,
			115, 115, 97, 103, 101, 0, 0, 0, 0, 9,
			124, 70, 105, 114, 101, 119, 111, 114, 107, 0,
			0, 0, 0, 18, 124, 70, 108, 105, 112, 82,
			101, 115, 117, 108, 116, 77, 101, 115, 115, 97,
			103, 101, 0, 0, 0, 0, 4, 124, 71, 97,
			114, 0, 0, 0, 0, 15, 124, 71, 101, 110,
			101, 114, 105, 99, 77, 101, 115, 115, 97, 103,
			101, 0, 0, 0, 0, 19, 124, 72, 101, 97,
			100, 115, 67, 104, 97, 110, 99, 101, 67, 111,
			117, 110, 116, 101, 114, 0, 0, 0, 0, 9,
			124, 76, 111, 103, 111, 70, 97, 100, 101, 0,
			0, 0, 0, 6, 124, 77, 97, 116, 104, 121,
			0, 0, 0, 0, 15, 124, 77, 101, 115, 115,
			97, 103, 101, 77, 97, 110, 97, 103, 101, 114,
			0, 0, 0, 0, 12, 124, 77, 101, 116, 97,
			77, 97, 110, 97, 103, 101, 114, 0, 0, 0,
			0, 13, 124, 77, 111, 110, 101, 121, 67, 111,
			117, 110, 116, 101, 114, 0, 0, 0, 0, 16,
			124, 78, 117, 109, 70, 108, 105, 112, 115, 67,
			111, 117, 110, 116, 101, 114, 0, 0, 0, 0,
			13, 124, 80, 97, 110, 101, 108, 77, 97, 110,
			97, 103, 101, 114, 0, 0, 0, 0, 29, 80,
			97, 110, 101, 108, 77, 97, 110, 97, 103, 101,
			114, 124, 80, 97, 110, 101, 108, 65, 114, 114,
			97, 110, 103, 101, 109, 101, 110, 116, 0, 0,
			0, 0, 12, 124, 80, 108, 97, 121, 101, 114,
			77, 111, 110, 101, 121, 0, 0, 0, 0, 11,
			124, 81, 117, 105, 116, 66, 117, 116, 116, 111,
			110, 0, 0, 0, 0, 14, 124, 82, 111, 99,
			107, 101, 116, 83, 112, 97, 119, 110, 101, 114,
			0, 0, 0, 0, 9, 124, 83, 97, 118, 101,
			103, 97, 109, 101, 0, 0, 0, 0, 7, 124,
			83, 104, 97, 100, 111, 119, 0, 0, 0, 0,
			11, 124, 83, 104, 111, 112, 66, 117, 116, 116,
			111, 110, 0, 0, 0, 0, 13, 124, 83, 116,
			101, 97, 109, 77, 97, 110, 97, 103, 101, 114
		};
		result.TotalFiles = 21;
		result.TotalTypes = 24;
		result.IsEditorOnly = false;
		return result;
	}
}