Decompiled source of Stage Practice v0.9.4

StagePractice.dll

Decompiled 4 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AddWatermark;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using HarmonyLib;
using LBoL.Base;
using LBoL.Base.Extensions;
using LBoL.ConfigData;
using LBoL.Core;
using LBoL.Core.Battle;
using LBoL.Core.Battle.Interactions;
using LBoL.Core.Cards;
using LBoL.Core.Randoms;
using LBoL.Core.Stations;
using LBoL.EntityLib.Exhibits.Adventure;
using LBoL.EntityLib.Exhibits.Shining;
using LBoL.Presentation;
using LBoL.Presentation.UI;
using LBoL.Presentation.UI.Panels;
using LBoL.Presentation.UI.Widgets;
using LBoLEntitySideloader;
using LBoLEntitySideloader.Attributes;
using LBoLEntitySideloader.Entities;
using LBoLEntitySideloader.Resource;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("LBoL.Base")]
[assembly: IgnoresAccessChecksTo("LBoL.ConfigData")]
[assembly: IgnoresAccessChecksTo("LBoL.Core")]
[assembly: IgnoresAccessChecksTo("LBoL.EntityLib")]
[assembly: IgnoresAccessChecksTo("LBoL.Presentation")]
[assembly: IgnoresAccessChecksTo("Untitled.ConfigDataBuilder.Base")]
[assembly: AssemblyCompany("StagePractice")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("StagePractice")]
[assembly: AssemblyTitle("StagePractice")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace StagePractice
{
	[BepInPlugin("intoxicatedkid.stagepractice", "Stage Practice", "0.9.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInProcess("LBoL.exe")]
	public class BepinexPlugin : BaseUnityPlugin
	{
		private static readonly Harmony harmony = PInfo.harmony;

		internal static ManualLogSource log;

		internal static TemplateSequenceTable sequenceTable = new TemplateSequenceTable(0);

		internal static IResourceSource embeddedSource = (IResourceSource)new EmbeddedSource(Assembly.GetExecutingAssembly());

		internal static DirectorySource directorySource = new DirectorySource("intoxicatedkid.stagepractice", "");

		private void Awake()
		{
			log = ((BaseUnityPlugin)this).Logger;
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			EntityManager.RegisterSelf();
			harmony.PatchAll();
			if (Chainloader.PluginInfos.ContainsKey("neo.lbol.tools.watermark"))
			{
				WatermarkWrapper.ActivateWatermark();
			}
		}

		private void OnDestroy()
		{
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}
	}
	public static class PInfo
	{
		public const string GUID = "intoxicatedkid.stagepractice";

		public const string Name = "Stage Practice";

		public const string version = "0.9.4";

		public static readonly Harmony harmony = new Harmony("intoxicatedkid.stagepractice");
	}
	internal class WatermarkWrapper
	{
		[MethodImpl(MethodImplOptions.NoInlining)]
		internal static void ActivateWatermark()
		{
			API.ActivateWatermark();
		}
	}
}
namespace StagePractice.JadeBoxes
{
	public sealed class StagePracticeAct2JadeBoxDef : JadeBoxTemplate
	{
		public override IdContainer GetId()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("StagePracticeAct2JadeBox");
		}

		public override LocalizationOption LoadLocalization()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			return (LocalizationOption)new DirectLocalization(new Dictionary<string, object>
			{
				{ "Name", "Stage Practice-Act 2-" },
				{ "Description", "Start the game on Act 2. Allows you to choose additional bonuses." }
			}, (Locale)0, (Locale)0, false);
		}

		public override JadeBoxConfig MakeConfig()
		{
			JadeBoxConfig val = ((JadeBoxTemplate)this).DefaultConfig();
			val.Group = new List<string> { "StagePractice" };
			return val;
		}
	}
	[EntityLogic(typeof(StagePracticeAct2JadeBoxDef))]
	public sealed class StagePracticeAct2JadeBox : JadeBox
	{
		protected override void OnAdded()
		{
			((JadeBox)this).HandleGameRunEvent<StationEventArgs>(((GameEntity)this).GameRun.StationEntered, (GameEventHandler<StationEventArgs>)delegate(StationEventArgs args)
			{
				Station station = args.Station;
				EntryStation val = (EntryStation)(object)((station is EntryStation) ? station : null);
				if (val != null && CollectionsExtensions.IndexOf<Stage>(((GameEntity)this).GameRun.Stages, ((Station)val).Stage) == 0)
				{
					((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(coroutine());
				}
			});
		}

		private IEnumerator coroutine()
		{
			((GameEntity)this).GameRun.GainMoney(((GameEntity)this).GameRun.DebutRng.NextInt(100, 150), false, (VisualSourceData)null);
			List<Type> shiningW = new List<Type>();
			List<Type> shiningU = new List<Type>();
			List<Type> shiningB = new List<Type>();
			List<Type> shiningR = new List<Type>();
			List<Type> shiningG = new List<Type>();
			List<Type> shiningC = new List<Type>();
			List<Type> shiningP = new List<Type>();
			List<Type> shiningX = new List<Type>();
			List<Type> shiningO = new List<Type>();
			foreach (var tc2 in from tc in Library.EnumerateExhibitTypes()
				orderby tc.config.Index descending
				select tc)
			{
				if ((int)tc2.Item2.Rarity == 3 && tc2.Item2.Owner != null && tc2.Item2.Owner != ((GameEntity)((GameEntity)this).GameRun.Player).Id && (tc2.Item2.Owner == "Reimu" || tc2.Item2.Owner == "Marisa" || tc2.Item2.Owner == "Sakuya" || tc2.Item2.Owner == "Cirno"))
				{
					shiningO.Add(tc2.Item1);
				}
				else if ((int)tc2.Item2.Rarity == 3 && tc2.Item2.Owner == null)
				{
					switch (tc2.Item2.BaseManaColor)
					{
					case 0L:
						shiningW.Add(tc2.Item1);
						break;
					case 1L:
						shiningU.Add(tc2.Item1);
						break;
					case 2L:
						shiningB.Add(tc2.Item1);
						break;
					case 3L:
						shiningR.Add(tc2.Item1);
						break;
					case 4L:
						shiningG.Add(tc2.Item1);
						break;
					case 5L:
						shiningC.Add(tc2.Item1);
						break;
					case 6L:
						shiningP.Add(tc2.Item1);
						break;
					default:
						shiningX.Add(tc2.Item1);
						break;
					}
				}
			}
			int l2 = 1;
			for (int i = 1; i < 2; i++)
			{
				List<Exhibit> final = new List<Exhibit>();
				if (i == 1)
				{
					IEnumerable<Exhibit> Olist = shiningO.Select((Type t) => Library.CreateExhibit(t));
					final.Add(CollectionsExtensions.Sample<Exhibit>(Olist.Where((Exhibit e) => e.Owner != ((GameEntity)this).GameRun.Player), ((GameEntity)this).GameRun.DebutRng));
				}
				UniqueRandomPool<int> obj = new UniqueRandomPool<int>(false);
				obj.Add(0, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)1) ? 0.0001f : 1f);
				obj.Add(1, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)2) ? 0.0001f : 1f);
				obj.Add(2, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)3) ? 0.0001f : 1f);
				obj.Add(3, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)4) ? 0.0001f : 1f);
				obj.Add(4, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)5) ? 0.0001f : 1f);
				obj.Add(5, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)6) ? 0.0001f : 1f);
				obj.Add(6, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)7) ? 0.0001f : 1f);
				obj.Add(7, final.Any((Exhibit e) => !e.Config.BaseManaColor.HasValue) ? 0.0001f : 1f);
				int[] selection = obj.SampleMany(((GameEntity)this).GameRun.DebutRng, 8, true);
				int n = ((i == 1) ? 2 : 3);
				for (int m = 0; m < n; m++)
				{
					switch (selection[m])
					{
					case 0:
					{
						IEnumerable<Exhibit> Wlist = shiningW.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit = CollectionsExtensions.Sample<Exhibit>(Wlist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit);
						}
						break;
					}
					case 1:
					{
						IEnumerable<Exhibit> Ulist = shiningU.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit2 = CollectionsExtensions.Sample<Exhibit>(Ulist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit2).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit2);
						}
						break;
					}
					case 2:
					{
						IEnumerable<Exhibit> Blist = shiningB.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit3 = CollectionsExtensions.Sample<Exhibit>(Blist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit3).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit3);
						}
						break;
					}
					case 3:
					{
						IEnumerable<Exhibit> Rlist = shiningR.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit4 = CollectionsExtensions.Sample<Exhibit>(Rlist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit4).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit4);
						}
						break;
					}
					case 4:
					{
						IEnumerable<Exhibit> Glist = shiningG.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit5 = CollectionsExtensions.Sample<Exhibit>(Glist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit5).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit5);
						}
						break;
					}
					case 5:
					{
						IEnumerable<Exhibit> Clist = shiningC.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit6 = CollectionsExtensions.Sample<Exhibit>(Clist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit6).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit6);
						}
						break;
					}
					case 6:
					{
						IEnumerable<Exhibit> Plist = shiningP.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit7 = CollectionsExtensions.Sample<Exhibit>(Plist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit7).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit7);
						}
						break;
					}
					case 7:
					{
						IEnumerable<Exhibit> Xlist = shiningX.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit8 = CollectionsExtensions.Sample<Exhibit>(Xlist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit8).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit8);
						}
						break;
					}
					}
				}
				((GameEntity)this).GameRun.CurrentStation.Rewards.Add(StationReward.CreateExhibit(final[0]));
				((GameEntity)this).GameRun.CurrentStation.Rewards.Add(StationReward.CreateExhibit(final[1]));
				((GameEntity)this).GameRun.CurrentStation.Rewards.Add(StationReward.CreateExhibit(final[2]));
				((UiPanel<ShowRewardContent>)(object)UiManager.GetPanel<RewardPanel>()).Show(new ShowRewardContent
				{
					Station = ((GameEntity)this).GameRun.CurrentStation,
					ShowNextButton = false
				});
				CollectionExtensions.Do<RewardWidget>((IEnumerable<RewardWidget>)UiManager.GetPanel<RewardPanel>()._rewardWidgets, (Action<RewardWidget>)delegate(RewardWidget rw)
				{
					rw.Click += delegate
					{
						if (UiManager.GetPanel<RewardPanel>()._rewardWidgets.Count <= 2)
						{
							((UiPanelBase)UiManager.GetPanel<RewardPanel>()).Hide();
							((GameEntity)this).GameRun.CurrentStation.Rewards.Clear();
						}
					};
				});
				yield return (object)new WaitUntil((Func<bool>)(() => !((UiBase)UiManager.GetPanel<RewardPanel>()).IsVisible));
				yield return (object)new WaitUntil((Func<bool>)(() => !((UiBase)UiManager.GetPanel<ShowCardsPanel>()).IsVisible));
				l2++;
			}
			yield return (object)new WaitUntil((Func<bool>)(() => l2 == 2));
			for (int j = 0; j < 2 + ((GameEntity)this).GameRun.DebutRng.NextInt(0, 0); j++)
			{
				yield return ((GameEntity)this).GameRun.GainExhibitRunner(((GameEntity)this).GameRun.CurrentStage.GetEliteEnemyExhibit(), false, (VisualSourceData)null);
			}
			yield return ((GameEntity)this).GameRun.GainExhibitRunner((Exhibit)(object)Library.CreateExhibit<WaijieYanjing>(), false, (VisualSourceData)null);
			for (int k = 0; k < 6 + ((GameEntity)this).GameRun.DebutRng.NextInt(0, 0); k++)
			{
				Card[] array2 = ((GameEntity)this).GameRun.RollCards(((GameEntity)this).GameRun.CardRng, new CardWeightTable(RarityWeightTable.EnemyCard, OwnerWeightTable.Valid, CardTypeWeightTable.CanBeLoot, false), 3, false, false, (Predicate<CardConfig>)null);
				((GameEntity)this).GameRun.UpgradeNewDeckCardOnFlags((IEnumerable<Card>)array2);
				MiniSelectCardInteraction interaction3 = new MiniSelectCardInteraction((IEnumerable<Card>)array2, false, false, false)
				{
					Source = (GameEntity)(object)this,
					CanCancel = false
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction3);
				((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)(object)new Card[1] { interaction3.SelectedCard }, false, (VisualSourceData)null);
				yield return (object)new WaitForSeconds(0.5f);
			}
			for (int l = 0; l < 1; l++)
			{
				Card[] array = ((GameEntity)this).GameRun.RollCards(((GameEntity)this).GameRun.CardRng, new CardWeightTable(RarityWeightTable.OnlyRare, OwnerWeightTable.Valid, CardTypeWeightTable.CanBeLoot, false), 3, false, false, (Predicate<CardConfig>)null);
				((GameEntity)this).GameRun.UpgradeNewDeckCardOnFlags((IEnumerable<Card>)array);
				MiniSelectCardInteraction interaction2 = new MiniSelectCardInteraction((IEnumerable<Card>)array, false, false, false)
				{
					Source = (GameEntity)(object)this,
					CanCancel = false
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction2);
				((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)(object)new Card[1] { interaction2.SelectedCard }, false, (VisualSourceData)null);
				yield return (object)new WaitForSeconds(0.5f);
			}
			((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)((GameEntity)this).GameRun.CurrentStage.GetShopToolCards(1 + ((GameEntity)this).GameRun.DebutRng.NextInt(0, 0)), false, (VisualSourceData)null);
			List<Card> list = ((GameEntity)this).GameRun.BaseDeck.ToList();
			if (list.Count > 0)
			{
				int trrng = ((GameEntity)this).GameRun.DebutRng.NextInt(1, 1);
				if (((GameEntity)this).GameRun.Player.HasExhibit<ShijieSuipian>())
				{
					trrng += 2;
				}
				SelectCardInteraction interaction = new SelectCardInteraction(trrng, trrng, ((GameEntity)this).GameRun.BaseDeckWithOutUnremovable, (SelectedCardHandling)0)
				{
					CanCancel = false,
					Description = "Choose a card to transform."
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction);
				if (!((Interaction)interaction).IsCanceled)
				{
					List<Card> list2 = new List<Card>();
					foreach (Card selectedCard in interaction.SelectedCards)
					{
						_ = selectedCard;
						list2.Add(((GameEntity)this).GameRun.RollTransformCard(((GameEntity)this).GameRun.GameRunEventRng, new CardWeightTable(RarityWeightTable.EliteCard, OwnerWeightTable.Valid, CardTypeWeightTable.CanBeLoot, false), false, false, (Predicate<CardConfig>)null));
					}
					((GameEntity)this).GameRun.RemoveDeckCards((IEnumerable<Card>)interaction.SelectedCards, true);
					((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)list2, true, (VisualSourceData)null);
				}
				yield return (object)new WaitForSeconds(0.5f);
				int uprng = ((GameEntity)this).GameRun.DebutRng.NextInt(2, 2);
				SelectCardInteraction interaction4 = new SelectCardInteraction(uprng, uprng, ((GameEntity)this).GameRun.BaseDeck.Where((Card card) => card.CanUpgrade), (SelectedCardHandling)0)
				{
					CanCancel = false,
					Description = "Choose a card to upgrade."
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction4);
				if (!((Interaction)interaction4).IsCanceled)
				{
					((GameEntity)this).GameRun.UpgradeDeckCards((IEnumerable<Card>)interaction4.SelectedCards, true);
				}
				yield return (object)new WaitForSeconds(0.5f);
				int rerng = ((GameEntity)this).GameRun.DebutRng.NextInt(1, 1);
				if (((GameEntity)this).GameRun.Player.HasExhibit<HouhuMen>())
				{
					rerng += 2;
				}
				SelectCardInteraction interaction5 = new SelectCardInteraction(rerng, rerng, ((GameEntity)this).GameRun.BaseDeckWithOutUnremovable, (SelectedCardHandling)0)
				{
					CanCancel = false,
					Description = "Choose a card to remove."
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction5);
				if (!((Interaction)interaction5).IsCanceled)
				{
					((GameEntity)this).GameRun.RemoveDeckCards((IEnumerable<Card>)interaction5.SelectedCards, true);
				}
			}
			yield return (object)new WaitUntil((Func<bool>)(() => (int)((GameEntity)this).GameRun.CurrentStation.Status == 4));
			Singleton<GameMaster>.Instance.CurrentGameRun._stageIndex = 0;
			GameMaster.RequestEnterNextStage();
		}
	}
	public sealed class StagePracticeAct3JadeBoxDef : JadeBoxTemplate
	{
		public override IdContainer GetId()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("StagePracticeAct3JadeBox");
		}

		public override LocalizationOption LoadLocalization()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			return (LocalizationOption)new DirectLocalization(new Dictionary<string, object>
			{
				{ "Name", "Stage Practice-Act 3-" },
				{ "Description", "Start the game on Act 3. Allows you to choose additional bonuses." }
			}, (Locale)0, (Locale)0, false);
		}

		public override JadeBoxConfig MakeConfig()
		{
			JadeBoxConfig val = ((JadeBoxTemplate)this).DefaultConfig();
			val.Group = new List<string> { "StagePractice" };
			return val;
		}
	}
	[EntityLogic(typeof(StagePracticeAct3JadeBoxDef))]
	public sealed class StagePracticeAct3JadeBox : JadeBox
	{
		protected override void OnAdded()
		{
			((JadeBox)this).HandleGameRunEvent<StationEventArgs>(((GameEntity)this).GameRun.StationEntered, (GameEventHandler<StationEventArgs>)delegate(StationEventArgs args)
			{
				Station station = args.Station;
				EntryStation val = (EntryStation)(object)((station is EntryStation) ? station : null);
				if (val != null && CollectionsExtensions.IndexOf<Stage>(((GameEntity)this).GameRun.Stages, ((Station)val).Stage) == 0)
				{
					((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(coroutine());
				}
			});
		}

		private IEnumerator coroutine()
		{
			((GameEntity)this).GameRun.GainMoney(((GameEntity)this).GameRun.DebutRng.NextInt(150, 225), false, (VisualSourceData)null);
			List<Type> shiningW = new List<Type>();
			List<Type> shiningU = new List<Type>();
			List<Type> shiningB = new List<Type>();
			List<Type> shiningR = new List<Type>();
			List<Type> shiningG = new List<Type>();
			List<Type> shiningC = new List<Type>();
			List<Type> shiningP = new List<Type>();
			List<Type> shiningX = new List<Type>();
			List<Type> shiningO = new List<Type>();
			foreach (var tc2 in from tc in Library.EnumerateExhibitTypes()
				orderby tc.config.Index descending
				select tc)
			{
				if ((int)tc2.Item2.Rarity == 3 && tc2.Item2.Owner != null && tc2.Item2.Owner != ((GameEntity)((GameEntity)this).GameRun.Player).Id && (tc2.Item2.Owner == "Reimu" || tc2.Item2.Owner == "Marisa" || tc2.Item2.Owner == "Sakuya" || tc2.Item2.Owner == "Cirno"))
				{
					shiningO.Add(tc2.Item1);
				}
				else if ((int)tc2.Item2.Rarity == 3 && tc2.Item2.Owner == null)
				{
					switch (tc2.Item2.BaseManaColor)
					{
					case 0L:
						shiningW.Add(tc2.Item1);
						break;
					case 1L:
						shiningU.Add(tc2.Item1);
						break;
					case 2L:
						shiningB.Add(tc2.Item1);
						break;
					case 3L:
						shiningR.Add(tc2.Item1);
						break;
					case 4L:
						shiningG.Add(tc2.Item1);
						break;
					case 5L:
						shiningC.Add(tc2.Item1);
						break;
					case 6L:
						shiningP.Add(tc2.Item1);
						break;
					default:
						shiningX.Add(tc2.Item1);
						break;
					}
				}
			}
			int l2 = 1;
			for (int i = 1; i < 3; i++)
			{
				List<Exhibit> final = new List<Exhibit>();
				if (i == 1)
				{
					IEnumerable<Exhibit> Olist = shiningO.Select((Type t) => Library.CreateExhibit(t));
					final.Add(CollectionsExtensions.Sample<Exhibit>(Olist.Where((Exhibit e) => e.Owner != ((GameEntity)this).GameRun.Player), ((GameEntity)this).GameRun.DebutRng));
				}
				UniqueRandomPool<int> obj = new UniqueRandomPool<int>(false);
				obj.Add(0, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)1) ? 0.0001f : 1f);
				obj.Add(1, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)2) ? 0.0001f : 1f);
				obj.Add(2, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)3) ? 0.0001f : 1f);
				obj.Add(3, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)4) ? 0.0001f : 1f);
				obj.Add(4, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)5) ? 0.0001f : 1f);
				obj.Add(5, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)6) ? 0.0001f : 1f);
				obj.Add(6, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)7) ? 0.0001f : 1f);
				obj.Add(7, final.Any((Exhibit e) => !e.Config.BaseManaColor.HasValue) ? 0.0001f : 1f);
				int[] selection = obj.SampleMany(((GameEntity)this).GameRun.DebutRng, 8, true);
				int n = ((i == 1) ? 2 : 3);
				for (int m = 0; m < n; m++)
				{
					switch (selection[m])
					{
					case 0:
					{
						IEnumerable<Exhibit> Wlist = shiningW.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit = CollectionsExtensions.Sample<Exhibit>(Wlist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit);
						}
						break;
					}
					case 1:
					{
						IEnumerable<Exhibit> Ulist = shiningU.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit2 = CollectionsExtensions.Sample<Exhibit>(Ulist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit2).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit2);
						}
						break;
					}
					case 2:
					{
						IEnumerable<Exhibit> Blist = shiningB.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit3 = CollectionsExtensions.Sample<Exhibit>(Blist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit3).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit3);
						}
						break;
					}
					case 3:
					{
						IEnumerable<Exhibit> Rlist = shiningR.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit4 = CollectionsExtensions.Sample<Exhibit>(Rlist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit4).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit4);
						}
						break;
					}
					case 4:
					{
						IEnumerable<Exhibit> Glist = shiningG.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit5 = CollectionsExtensions.Sample<Exhibit>(Glist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit5).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit5);
						}
						break;
					}
					case 5:
					{
						IEnumerable<Exhibit> Clist = shiningC.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit6 = CollectionsExtensions.Sample<Exhibit>(Clist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit6).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit6);
						}
						break;
					}
					case 6:
					{
						IEnumerable<Exhibit> Plist = shiningP.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit7 = CollectionsExtensions.Sample<Exhibit>(Plist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit7).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit7);
						}
						break;
					}
					case 7:
					{
						IEnumerable<Exhibit> Xlist = shiningX.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit8 = CollectionsExtensions.Sample<Exhibit>(Xlist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit8).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit8);
						}
						break;
					}
					}
				}
				((GameEntity)this).GameRun.CurrentStation.Rewards.Add(StationReward.CreateExhibit(final[0]));
				((GameEntity)this).GameRun.CurrentStation.Rewards.Add(StationReward.CreateExhibit(final[1]));
				((GameEntity)this).GameRun.CurrentStation.Rewards.Add(StationReward.CreateExhibit(final[2]));
				((UiPanel<ShowRewardContent>)(object)UiManager.GetPanel<RewardPanel>()).Show(new ShowRewardContent
				{
					Station = ((GameEntity)this).GameRun.CurrentStation,
					ShowNextButton = false
				});
				CollectionExtensions.Do<RewardWidget>((IEnumerable<RewardWidget>)UiManager.GetPanel<RewardPanel>()._rewardWidgets, (Action<RewardWidget>)delegate(RewardWidget rw)
				{
					rw.Click += delegate
					{
						if (UiManager.GetPanel<RewardPanel>()._rewardWidgets.Count <= 2)
						{
							((UiPanelBase)UiManager.GetPanel<RewardPanel>()).Hide();
							((GameEntity)this).GameRun.CurrentStation.Rewards.Clear();
						}
					};
				});
				yield return (object)new WaitUntil((Func<bool>)(() => !((UiBase)UiManager.GetPanel<RewardPanel>()).IsVisible));
				yield return (object)new WaitUntil((Func<bool>)(() => !((UiBase)UiManager.GetPanel<ShowCardsPanel>()).IsVisible));
				l2++;
			}
			yield return (object)new WaitUntil((Func<bool>)(() => l2 == 3));
			for (int j = 0; j < 4 + ((GameEntity)this).GameRun.DebutRng.NextInt(0, 1); j++)
			{
				yield return ((GameEntity)this).GameRun.GainExhibitRunner(((GameEntity)this).GameRun.CurrentStage.GetEliteEnemyExhibit(), false, (VisualSourceData)null);
			}
			yield return ((GameEntity)this).GameRun.GainExhibitRunner((Exhibit)(object)Library.CreateExhibit<WaijieYouxiji>(), false, (VisualSourceData)null);
			for (int k = 0; k < 9 + ((GameEntity)this).GameRun.DebutRng.NextInt(0, 1); k++)
			{
				Card[] array2 = ((GameEntity)this).GameRun.RollCards(((GameEntity)this).GameRun.CardRng, new CardWeightTable(RarityWeightTable.EnemyCard, OwnerWeightTable.Valid, CardTypeWeightTable.CanBeLoot, false), 3, false, false, (Predicate<CardConfig>)null);
				((GameEntity)this).GameRun.UpgradeNewDeckCardOnFlags((IEnumerable<Card>)array2);
				MiniSelectCardInteraction interaction3 = new MiniSelectCardInteraction((IEnumerable<Card>)array2, false, false, false)
				{
					Source = (GameEntity)(object)this,
					CanCancel = false
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction3);
				((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)(object)new Card[1] { interaction3.SelectedCard }, false, (VisualSourceData)null);
				yield return (object)new WaitForSeconds(0.5f);
			}
			for (int l = 0; l < 2; l++)
			{
				Card[] array = ((GameEntity)this).GameRun.RollCards(((GameEntity)this).GameRun.CardRng, new CardWeightTable(RarityWeightTable.OnlyRare, OwnerWeightTable.Valid, CardTypeWeightTable.CanBeLoot, false), 3, false, false, (Predicate<CardConfig>)null);
				((GameEntity)this).GameRun.UpgradeNewDeckCardOnFlags((IEnumerable<Card>)array);
				MiniSelectCardInteraction interaction2 = new MiniSelectCardInteraction((IEnumerable<Card>)array, false, false, false)
				{
					Source = (GameEntity)(object)this,
					CanCancel = false
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction2);
				((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)(object)new Card[1] { interaction2.SelectedCard }, false, (VisualSourceData)null);
				yield return (object)new WaitForSeconds(0.5f);
			}
			((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)((GameEntity)this).GameRun.CurrentStage.GetShopToolCards(1 + ((GameEntity)this).GameRun.DebutRng.NextInt(0, 1)), false, (VisualSourceData)null);
			List<Card> list = ((GameEntity)this).GameRun.BaseDeck.ToList();
			if (list.Count > 0)
			{
				int trrng = ((GameEntity)this).GameRun.DebutRng.NextInt(1, 2);
				if (((GameEntity)this).GameRun.Player.HasExhibit<ShijieSuipian>())
				{
					trrng += 2;
				}
				SelectCardInteraction interaction = new SelectCardInteraction(trrng, trrng, ((GameEntity)this).GameRun.BaseDeckWithOutUnremovable, (SelectedCardHandling)0)
				{
					CanCancel = false,
					Description = "Choose a card to transform."
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction);
				if (!((Interaction)interaction).IsCanceled)
				{
					List<Card> list2 = new List<Card>();
					foreach (Card selectedCard in interaction.SelectedCards)
					{
						_ = selectedCard;
						list2.Add(((GameEntity)this).GameRun.RollTransformCard(((GameEntity)this).GameRun.GameRunEventRng, new CardWeightTable(RarityWeightTable.EliteCard, OwnerWeightTable.Valid, CardTypeWeightTable.CanBeLoot, false), false, false, (Predicate<CardConfig>)null));
					}
					((GameEntity)this).GameRun.RemoveDeckCards((IEnumerable<Card>)interaction.SelectedCards, true);
					((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)list2, true, (VisualSourceData)null);
				}
				yield return (object)new WaitForSeconds(0.5f);
				int uprng = ((GameEntity)this).GameRun.DebutRng.NextInt(4, 5);
				SelectCardInteraction interaction4 = new SelectCardInteraction(uprng, uprng, ((GameEntity)this).GameRun.BaseDeck.Where((Card card) => card.CanUpgrade), (SelectedCardHandling)0)
				{
					CanCancel = false,
					Description = "Choose a card to upgrade."
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction4);
				if (!((Interaction)interaction4).IsCanceled)
				{
					((GameEntity)this).GameRun.UpgradeDeckCards((IEnumerable<Card>)interaction4.SelectedCards, true);
				}
				yield return (object)new WaitForSeconds(0.5f);
				int rerng = ((GameEntity)this).GameRun.DebutRng.NextInt(2, 3);
				if (((GameEntity)this).GameRun.Player.HasExhibit<HouhuMen>())
				{
					rerng += 2;
				}
				SelectCardInteraction interaction5 = new SelectCardInteraction(rerng, rerng, ((GameEntity)this).GameRun.BaseDeckWithOutUnremovable, (SelectedCardHandling)0)
				{
					CanCancel = false,
					Description = "Choose a card to remove."
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction5);
				if (!((Interaction)interaction5).IsCanceled)
				{
					((GameEntity)this).GameRun.RemoveDeckCards((IEnumerable<Card>)interaction5.SelectedCards, true);
				}
			}
			yield return (object)new WaitUntil((Func<bool>)(() => (int)((GameEntity)this).GameRun.CurrentStation.Status == 4));
			Singleton<GameMaster>.Instance.CurrentGameRun._stageIndex = 1;
			GameMaster.RequestEnterNextStage();
		}
	}
	public sealed class StagePracticeAct4JadeBoxDef : JadeBoxTemplate
	{
		public override IdContainer GetId()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("StagePracticeAct4JadeBox");
		}

		public override LocalizationOption LoadLocalization()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			return (LocalizationOption)new DirectLocalization(new Dictionary<string, object>
			{
				{ "Name", "Stage Practice-Act 4-" },
				{ "Description", "Start the game on Act 4. Allows you to choose additional bonuses." }
			}, (Locale)0, (Locale)0, false);
		}

		public override JadeBoxConfig MakeConfig()
		{
			JadeBoxConfig val = ((JadeBoxTemplate)this).DefaultConfig();
			val.Group = new List<string> { "StagePractice" };
			return val;
		}
	}
	[EntityLogic(typeof(StagePracticeAct4JadeBoxDef))]
	public sealed class StagePracticeAct4JadeBox : JadeBox
	{
		protected override void OnAdded()
		{
			((JadeBox)this).HandleGameRunEvent<StationEventArgs>(((GameEntity)this).GameRun.StationEntered, (GameEventHandler<StationEventArgs>)delegate(StationEventArgs args)
			{
				Station station = args.Station;
				EntryStation val = (EntryStation)(object)((station is EntryStation) ? station : null);
				if (val != null && CollectionsExtensions.IndexOf<Stage>(((GameEntity)this).GameRun.Stages, ((Station)val).Stage) == 0)
				{
					((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(coroutine());
				}
			});
		}

		private IEnumerator coroutine()
		{
			((GameEntity)this).GameRun.GainMoney(((GameEntity)this).GameRun.DebutRng.NextInt(200, 300), false, (VisualSourceData)null);
			List<Type> shiningW = new List<Type>();
			List<Type> shiningU = new List<Type>();
			List<Type> shiningB = new List<Type>();
			List<Type> shiningR = new List<Type>();
			List<Type> shiningG = new List<Type>();
			List<Type> shiningC = new List<Type>();
			List<Type> shiningP = new List<Type>();
			List<Type> shiningX = new List<Type>();
			List<Type> shiningO = new List<Type>();
			foreach (var tc2 in from tc in Library.EnumerateExhibitTypes()
				orderby tc.config.Index descending
				select tc)
			{
				if ((int)tc2.Item2.Rarity == 3 && tc2.Item2.Owner != null && tc2.Item2.Owner != ((GameEntity)((GameEntity)this).GameRun.Player).Id && (tc2.Item2.Owner == "Reimu" || tc2.Item2.Owner == "Marisa" || tc2.Item2.Owner == "Sakuya" || tc2.Item2.Owner == "Cirno"))
				{
					shiningO.Add(tc2.Item1);
				}
				else if ((int)tc2.Item2.Rarity == 3 && tc2.Item2.Owner == null)
				{
					switch (tc2.Item2.BaseManaColor)
					{
					case 0L:
						shiningW.Add(tc2.Item1);
						break;
					case 1L:
						shiningU.Add(tc2.Item1);
						break;
					case 2L:
						shiningB.Add(tc2.Item1);
						break;
					case 3L:
						shiningR.Add(tc2.Item1);
						break;
					case 4L:
						shiningG.Add(tc2.Item1);
						break;
					case 5L:
						shiningC.Add(tc2.Item1);
						break;
					case 6L:
						shiningP.Add(tc2.Item1);
						break;
					default:
						shiningX.Add(tc2.Item1);
						break;
					}
				}
			}
			int l2 = 1;
			for (int i = 1; i < 4; i++)
			{
				List<Exhibit> final = new List<Exhibit>();
				if (i == 1)
				{
					IEnumerable<Exhibit> Olist = shiningO.Select((Type t) => Library.CreateExhibit(t));
					final.Add(CollectionsExtensions.Sample<Exhibit>(Olist.Where((Exhibit e) => e.Owner != ((GameEntity)this).GameRun.Player), ((GameEntity)this).GameRun.DebutRng));
				}
				UniqueRandomPool<int> obj = new UniqueRandomPool<int>(false);
				obj.Add(0, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)1) ? 0.0001f : 1f);
				obj.Add(1, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)2) ? 0.0001f : 1f);
				obj.Add(2, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)3) ? 0.0001f : 1f);
				obj.Add(3, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)4) ? 0.0001f : 1f);
				obj.Add(4, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)5) ? 0.0001f : 1f);
				obj.Add(5, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)6) ? 0.0001f : 1f);
				obj.Add(6, final.Any((Exhibit e) => e.Config.BaseManaColor == (ManaColor?)7) ? 0.0001f : 1f);
				obj.Add(7, final.Any((Exhibit e) => !e.Config.BaseManaColor.HasValue) ? 0.0001f : 1f);
				int[] selection = obj.SampleMany(((GameEntity)this).GameRun.DebutRng, 8, true);
				int n = ((i == 1) ? 2 : 3);
				for (int m = 0; m < n; m++)
				{
					switch (selection[m])
					{
					case 0:
					{
						IEnumerable<Exhibit> Wlist = shiningW.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit = CollectionsExtensions.Sample<Exhibit>(Wlist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit);
						}
						break;
					}
					case 1:
					{
						IEnumerable<Exhibit> Ulist = shiningU.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit2 = CollectionsExtensions.Sample<Exhibit>(Ulist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit2).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit2);
						}
						break;
					}
					case 2:
					{
						IEnumerable<Exhibit> Blist = shiningB.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit3 = CollectionsExtensions.Sample<Exhibit>(Blist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit3).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit3);
						}
						break;
					}
					case 3:
					{
						IEnumerable<Exhibit> Rlist = shiningR.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit4 = CollectionsExtensions.Sample<Exhibit>(Rlist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit4).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit4);
						}
						break;
					}
					case 4:
					{
						IEnumerable<Exhibit> Glist = shiningG.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit5 = CollectionsExtensions.Sample<Exhibit>(Glist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit5).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit5);
						}
						break;
					}
					case 5:
					{
						IEnumerable<Exhibit> Clist = shiningC.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit6 = CollectionsExtensions.Sample<Exhibit>(Clist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit6).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit6);
						}
						break;
					}
					case 6:
					{
						IEnumerable<Exhibit> Plist = shiningP.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit7 = CollectionsExtensions.Sample<Exhibit>(Plist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit7).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit7);
						}
						break;
					}
					case 7:
					{
						IEnumerable<Exhibit> Xlist = shiningX.Select((Type t) => Library.CreateExhibit(t));
						Exhibit exhibit8 = CollectionsExtensions.Sample<Exhibit>(Xlist, ((GameEntity)this).GameRun.DebutRng);
						if (((GameEntity)this).GameRun.Player.Exhibits.Any((Exhibit e) => ((GameEntity)e).Id == ((GameEntity)exhibit8).Id))
						{
							m--;
						}
						else
						{
							final.Add(exhibit8);
						}
						break;
					}
					}
				}
				((GameEntity)this).GameRun.CurrentStation.Rewards.Add(StationReward.CreateExhibit(final[0]));
				((GameEntity)this).GameRun.CurrentStation.Rewards.Add(StationReward.CreateExhibit(final[1]));
				((GameEntity)this).GameRun.CurrentStation.Rewards.Add(StationReward.CreateExhibit(final[2]));
				((UiPanel<ShowRewardContent>)(object)UiManager.GetPanel<RewardPanel>()).Show(new ShowRewardContent
				{
					Station = ((GameEntity)this).GameRun.CurrentStation,
					ShowNextButton = false
				});
				CollectionExtensions.Do<RewardWidget>((IEnumerable<RewardWidget>)UiManager.GetPanel<RewardPanel>()._rewardWidgets, (Action<RewardWidget>)delegate(RewardWidget rw)
				{
					rw.Click += delegate
					{
						if (UiManager.GetPanel<RewardPanel>()._rewardWidgets.Count <= 2)
						{
							((UiPanelBase)UiManager.GetPanel<RewardPanel>()).Hide();
							((GameEntity)this).GameRun.CurrentStation.Rewards.Clear();
						}
					};
				});
				yield return (object)new WaitUntil((Func<bool>)(() => !((UiBase)UiManager.GetPanel<RewardPanel>()).IsVisible));
				yield return (object)new WaitUntil((Func<bool>)(() => !((UiBase)UiManager.GetPanel<ShowCardsPanel>()).IsVisible));
				l2++;
			}
			yield return (object)new WaitUntil((Func<bool>)(() => l2 == 4));
			for (int j = 0; j < 6 + ((GameEntity)this).GameRun.DebutRng.NextInt(0, 2); j++)
			{
				yield return ((GameEntity)this).GameRun.GainExhibitRunner(((GameEntity)this).GameRun.CurrentStage.GetEliteEnemyExhibit(), false, (VisualSourceData)null);
			}
			yield return ((GameEntity)this).GameRun.GainExhibitRunner((Exhibit)(object)Library.CreateExhibit<JingjieGanzhiyi>(), false, (VisualSourceData)null);
			for (int k = 0; k < 12 + ((GameEntity)this).GameRun.DebutRng.NextInt(0, 2); k++)
			{
				Card[] array2 = ((GameEntity)this).GameRun.RollCards(((GameEntity)this).GameRun.CardRng, new CardWeightTable(RarityWeightTable.EnemyCard, OwnerWeightTable.Valid, CardTypeWeightTable.CanBeLoot, false), 3, false, false, (Predicate<CardConfig>)null);
				((GameEntity)this).GameRun.UpgradeNewDeckCardOnFlags((IEnumerable<Card>)array2);
				MiniSelectCardInteraction interaction3 = new MiniSelectCardInteraction((IEnumerable<Card>)array2, false, false, false)
				{
					Source = (GameEntity)(object)this,
					CanCancel = false
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction3);
				((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)(object)new Card[1] { interaction3.SelectedCard }, false, (VisualSourceData)null);
				yield return (object)new WaitForSeconds(0.5f);
			}
			for (int l = 0; l < 3; l++)
			{
				Card[] array = ((GameEntity)this).GameRun.RollCards(((GameEntity)this).GameRun.CardRng, new CardWeightTable(RarityWeightTable.OnlyRare, OwnerWeightTable.Valid, CardTypeWeightTable.CanBeLoot, false), 3, false, false, (Predicate<CardConfig>)null);
				((GameEntity)this).GameRun.UpgradeNewDeckCardOnFlags((IEnumerable<Card>)array);
				MiniSelectCardInteraction interaction2 = new MiniSelectCardInteraction((IEnumerable<Card>)array, false, false, false)
				{
					Source = (GameEntity)(object)this,
					CanCancel = false
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction2);
				((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)(object)new Card[1] { interaction2.SelectedCard }, false, (VisualSourceData)null);
				yield return (object)new WaitForSeconds(0.5f);
			}
			((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)((GameEntity)this).GameRun.CurrentStage.GetShopToolCards(1 + ((GameEntity)this).GameRun.DebutRng.NextInt(0, 2)), false, (VisualSourceData)null);
			List<Card> list = ((GameEntity)this).GameRun.BaseDeck.ToList();
			if (list.Count > 0)
			{
				int trrng = ((GameEntity)this).GameRun.DebutRng.NextInt(1, 3);
				if (((GameEntity)this).GameRun.Player.HasExhibit<ShijieSuipian>())
				{
					trrng += 2;
				}
				SelectCardInteraction interaction = new SelectCardInteraction(trrng, trrng, ((GameEntity)this).GameRun.BaseDeckWithOutUnremovable, (SelectedCardHandling)0)
				{
					CanCancel = false,
					Description = "Choose a card to transform."
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction);
				if (!((Interaction)interaction).IsCanceled)
				{
					List<Card> list2 = new List<Card>();
					foreach (Card selectedCard in interaction.SelectedCards)
					{
						_ = selectedCard;
						list2.Add(((GameEntity)this).GameRun.RollTransformCard(((GameEntity)this).GameRun.GameRunEventRng, new CardWeightTable(RarityWeightTable.EliteCard, OwnerWeightTable.Valid, CardTypeWeightTable.CanBeLoot, false), false, false, (Predicate<CardConfig>)null));
					}
					((GameEntity)this).GameRun.RemoveDeckCards((IEnumerable<Card>)interaction.SelectedCards, true);
					((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)list2, true, (VisualSourceData)null);
				}
				yield return (object)new WaitForSeconds(0.5f);
				int uprng = ((GameEntity)this).GameRun.DebutRng.NextInt(6, 8);
				SelectCardInteraction interaction4 = new SelectCardInteraction(uprng, uprng, ((GameEntity)this).GameRun.BaseDeck.Where((Card card) => card.CanUpgrade), (SelectedCardHandling)0)
				{
					CanCancel = false,
					Description = "Choose a card to upgrade."
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction4);
				if (!((Interaction)interaction4).IsCanceled)
				{
					((GameEntity)this).GameRun.UpgradeDeckCards((IEnumerable<Card>)interaction4.SelectedCards, true);
				}
				yield return (object)new WaitForSeconds(0.5f);
				int rerng = ((GameEntity)this).GameRun.DebutRng.NextInt(3, 5);
				if (((GameEntity)this).GameRun.Player.HasExhibit<HouhuMen>())
				{
					rerng += 2;
				}
				SelectCardInteraction interaction5 = new SelectCardInteraction(rerng, rerng, ((GameEntity)this).GameRun.BaseDeckWithOutUnremovable, (SelectedCardHandling)0)
				{
					CanCancel = false,
					Description = "Choose a card to remove."
				};
				yield return ((GameEntity)this).GameRun.InteractionViewer.View((Interaction)(object)interaction5);
				if (!((Interaction)interaction5).IsCanceled)
				{
					((GameEntity)this).GameRun.RemoveDeckCards((IEnumerable<Card>)interaction5.SelectedCards, true);
				}
			}
			yield return (object)new WaitUntil((Func<bool>)(() => (int)((GameEntity)this).GameRun.CurrentStation.Status == 4));
			Singleton<GameMaster>.Instance.CurrentGameRun._stageIndex = 2;
			GameMaster.RequestEnterNextStage();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}