Decompiled source of Aya Shameimaru v0.1.11

AyaShameimaru.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AddWatermark;
using AyaShameimaru.Cards;
using AyaShameimaru.EnemyUnits;
using AyaShameimaru.Exhibits;
using AyaShameimaru.PlayerUnits;
using AyaShameimaru.StatusEffects;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using Cysharp.Threading.Tasks;
using DG.Tweening;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
using HarmonyLib;
using JetBrains.Annotations;
using LBoL.Base;
using LBoL.Base.Extensions;
using LBoL.ConfigData;
using LBoL.Core;
using LBoL.Core.Battle;
using LBoL.Core.Battle.BattleActions;
using LBoL.Core.Battle.Interactions;
using LBoL.Core.Cards;
using LBoL.Core.Helpers;
using LBoL.Core.Intentions;
using LBoL.Core.Randoms;
using LBoL.Core.Stations;
using LBoL.Core.StatusEffects;
using LBoL.Core.Units;
using LBoL.EntityLib.Cards.Character.Cirno;
using LBoL.EntityLib.Cards.Character.Cirno.Friend;
using LBoL.EntityLib.Cards.Character.Marisa;
using LBoL.EntityLib.Cards.Character.Reimu;
using LBoL.EntityLib.Cards.Character.Sakuya;
using LBoL.EntityLib.Cards.Enemy;
using LBoL.EntityLib.Cards.Neutral.Black;
using LBoL.EntityLib.Cards.Neutral.Blue;
using LBoL.EntityLib.Cards.Neutral.Green;
using LBoL.EntityLib.Cards.Neutral.MultiColor;
using LBoL.EntityLib.Cards.Neutral.NoColor;
using LBoL.EntityLib.Cards.Neutral.Red;
using LBoL.EntityLib.Cards.Neutral.TwoColor;
using LBoL.EntityLib.Cards.Neutral.White;
using LBoL.EntityLib.EnemyUnits.Character;
using LBoL.EntityLib.EnemyUnits.Opponent;
using LBoL.EntityLib.Exhibits;
using LBoL.EntityLib.Exhibits.Shining;
using LBoL.EntityLib.StatusEffects.Basic;
using LBoL.EntityLib.StatusEffects.Enemy;
using LBoL.EntityLib.StatusEffects.Enemy.SeijaItems;
using LBoL.EntityLib.StatusEffects.Reimu;
using LBoL.Presentation;
using LBoL.Presentation.UI;
using LBoL.Presentation.Units;
using LBoLEntitySideloader;
using LBoLEntitySideloader.Attributes;
using LBoLEntitySideloader.Entities;
using LBoLEntitySideloader.ExtraFunc;
using LBoLEntitySideloader.Resource;
using LBoLEntitySideloader.Utils;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

[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("AyaShameimaru")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AyaShameimaru")]
[assembly: AssemblyTitle("AyaShameimaru")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace AyaShameimaru
{
	[BepInPlugin("intoxicatedkid.ayashameimaru", "Aya Shameimaru", "0.1.11")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInProcess("LBoL.exe")]
	public class BepinexPlugin : BaseUnityPlugin
	{
		private static readonly Harmony harmony = PluginInfo.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.ayashameimaru", "");

		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();
			}
			AyaBackgrounds.AddAyaBackgrounds();
		}

		private void OnDestroy()
		{
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}
	}
	public static class AyaBackgrounds
	{
		public const string AyaBackground = "AyaBackground";

		public const string AyaBackgroundTransition = "AyaBackgroundTransition";

		public const string AyaTanukiBackground = "AyaTanukiBackground";

		public static void AddAyaBackgrounds()
		{
			StageTemplate.AddEvironmentGameobject(StageTemplate.CreateSimpleEnvObject("AyaBackground", ResourceLoader.LoadSprite("AyaBackground.png", (IResourceSource)(object)BepinexPlugin.directorySource, (Rect?)null, 80, (Vector2?)null)), false, (Func<GameObject, GameObject>)delegate(GameObject self)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: 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)
				Transform transform3 = self.transform;
				transform3.position += new Vector3(0f, 0f, -0.1f);
				return self;
			}, (string)null, (Assembly)null);
			StageTemplate.AddEvironmentGameobject(StageTemplate.CreateSimpleEnvObject("AyaBackgroundTransition", ResourceLoader.LoadSprite("AyaBackgroundTransition.png", (IResourceSource)(object)BepinexPlugin.directorySource, (Rect?)null, 100, (Vector2?)null)), false, (Func<GameObject, GameObject>)delegate(GameObject self)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: 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)
				Transform transform2 = self.transform;
				transform2.position += new Vector3(0f, 0f, -0.2f);
				return self;
			}, (string)null, (Assembly)null);
			StageTemplate.AddEvironmentGameobject(StageTemplate.CreateSimpleEnvObject("AyaTanukiBackground", ResourceLoader.LoadSprite("AyaTanukiBackground.png", (IResourceSource)(object)BepinexPlugin.directorySource, (Rect?)null, 100, (Vector2?)null)), false, (Func<GameObject, GameObject>)delegate(GameObject self)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: 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)
				Transform transform = self.transform;
				transform.position += new Vector3(0f, 0f, -0.1f);
				return self;
			}, (string)null, (Assembly)null);
		}
	}
	public static class PluginInfo
	{
		public const string GUID = "intoxicatedkid.ayashameimaru";

		public const string Name = "Aya Shameimaru";

		public const string version = "0.1.11";

		public static readonly Harmony harmony = new Harmony("intoxicatedkid.ayashameimaru");
	}
	internal class WatermarkWrapper
	{
		[MethodImpl(MethodImplOptions.NoInlining)]
		internal static void ActivateWatermark()
		{
			API.ActivateWatermark();
		}
	}
}
namespace AyaShameimaru.StatusEffects
{
	public sealed class AyaAccelerationSeDef : StatusEffectTemplate
	{
		[EntityLogic(typeof(AyaAccelerationSeDef))]
		public sealed class AyaAccelerationSe : StatusEffect
		{
			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).HandleOwnerEvent<StatusEffectApplyEventArgs>(((StatusEffect)this).Owner.StatusEffectAdded, (GameEventHandler<StatusEffectApplyEventArgs>)delegate
				{
					int count3 = MathExtensions.RoundToInt(Math.Truncate((float)((StatusEffect)this).Level / 4f));
					((StatusEffect)this).Count = count3;
				});
				((StatusEffect)this).HandleOwnerEvent<StatusEffectEventArgs>(((StatusEffect)this).Owner.StatusEffectChanged, (GameEventHandler<StatusEffectEventArgs>)delegate
				{
					int count2 = MathExtensions.RoundToInt(Math.Truncate((float)((StatusEffect)this).Level / 4f));
					((StatusEffect)this).Count = count2;
				});
				((StatusEffect)this).HandleOwnerEvent<StatusEffectEventArgs>(((StatusEffect)this).Owner.StatusEffectRemoved, (GameEventHandler<StatusEffectEventArgs>)delegate
				{
					int count = MathExtensions.RoundToInt(Math.Truncate((float)((StatusEffect)this).Level / 4f));
					((StatusEffect)this).Count = count;
				});
				((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((StatusEffect)this).Owner.TurnEnding, (EventSequencedReactor<UnitEventArgs>)OnOwnerTurnEnding);
				((StatusEffect)this).ReactOwnerEvent<DamageEventArgs>(((StatusEffect)this).Owner.DamageReceived, (EventSequencedReactor<DamageEventArgs>)OnOwnerDamageReceived);
			}

			private IEnumerable<BattleAction> OnOwnerTurnEnding(GameEventArgs args)
			{
				foreach (BattleAction item in Activate())
				{
					yield return item;
				}
			}

			public IEnumerable<BattleAction> Activate()
			{
				if (!((StatusEffect)this).Battle.BattleShouldEnd)
				{
					AyaEvasionSeDef.AyaEvasionSe statusEffect = ((StatusEffect)this).Owner.GetStatusEffect<AyaEvasionSeDef.AyaEvasionSe>();
					int num = ((statusEffect != null) ? ((StatusEffect)statusEffect).Level : 0);
					int num2 = MathExtensions.RoundToInt(Math.Truncate((float)((StatusEffect)this).Level / 4f));
					if (num < num2)
					{
						yield return (BattleAction)(object)new ApplyStatusEffectAction<AyaEvasionSeDef.AyaEvasionSe>(((StatusEffect)this).Owner, (int?)(num2 - num), (int?)null, (int?)null, (int?)null, 0f, true);
					}
				}
			}

			private IEnumerable<BattleAction> OnOwnerDamageReceived(DamageEventArgs args)
			{
				DamageInfo damageInfo = args.DamageInfo;
				if (((DamageInfo)(ref damageInfo)).IsGrazed)
				{
					int level = ((StatusEffect)this).Level;
					((StatusEffect)this).Level = level - 1;
					if (((StatusEffect)this).Level <= 0)
					{
						yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
					}
				}
			}

			public OpposeResult Oppose(AyaDecelerationSeDef.AyaDecelerationSe other)
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: 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)
				if (((StatusEffect)this).Level < ((StatusEffect)other).Level)
				{
					((StatusEffect)other).Level = ((StatusEffect)other).Level - ((StatusEffect)this).Level;
					return (OpposeResult)1;
				}
				if (((StatusEffect)this).Level == ((StatusEffect)other).Level)
				{
					return (OpposeResult)2;
				}
				((StatusEffect)this).Level = ((StatusEffect)this).Level - ((StatusEffect)other).Level;
				return (OpposeResult)0;
			}
		}

		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("AyaAccelerationSe");
		}

		public override LocalizationOption LoadLocalization()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GlobalLocalization val = new GlobalLocalization((IResourceSource)(object)BepinexPlugin.directorySource);
			val.DiscoverAndLoadLocFiles((EntityDefinition)(object)this);
			return (LocalizationOption)(object)val;
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("Resources.AyaAccelerationSe.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
		}

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(StatusEffectConfig)), "", 0, (StatusEffectType)0, false, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)(StackType)0, (DurationDecreaseTiming)0, true, (StackType?)(StackType)4, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string> { "AyaEvasionSe" }, "Default", "Default", "Default");
		}
	}
	public sealed class AyaDecelerationSeDef : StatusEffectTemplate
	{
		[EntityLogic(typeof(AyaDecelerationSeDef))]
		public sealed class AyaDecelerationSe : StatusEffect
		{
			public OpposeResult Oppose(AyaAccelerationSeDef.AyaAccelerationSe other)
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: 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)
				if (((StatusEffect)this).Level < ((StatusEffect)other).Level)
				{
					((StatusEffect)other).Level = ((StatusEffect)other).Level - ((StatusEffect)this).Level;
					return (OpposeResult)1;
				}
				if (((StatusEffect)this).Level == ((StatusEffect)other).Level)
				{
					return (OpposeResult)2;
				}
				((StatusEffect)this).Level = ((StatusEffect)this).Level - ((StatusEffect)other).Level;
				return (OpposeResult)0;
			}
		}

		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("AyaDecelerationSe");
		}

		public override LocalizationOption LoadLocalization()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GlobalLocalization val = new GlobalLocalization((IResourceSource)(object)BepinexPlugin.directorySource);
			val.DiscoverAndLoadLocFiles((EntityDefinition)(object)this);
			return (LocalizationOption)(object)val;
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("Resources.AyaDecelerationSe.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
		}

		public override StatusEffectConfig MakeConfig()
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(StatusEffectConfig)), "", 1, (StatusEffectType)0, false, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)(StackType)0, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class AyaEvasionSeDef : StatusEffectTemplate
	{
		[EntityLogic(typeof(AyaEvasionSeDef))]
		public sealed class AyaEvasionSe : StatusEffect
		{
			[HarmonyPatch(typeof(Unit), "MeasureDamage")]
			private class Unit_MeasureDamage_Patch
			{
				private static bool Prefix(Unit __instance, ref DamageInfo info, ref DamageInfo __result)
				{
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0010: Invalid comparison between Unknown and I4
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					//IL_004a: 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_0058: 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_0066: Unknown result type (might be due to invalid IL or missing references)
					//IL_006b: Unknown result type (might be due to invalid IL or missing references)
					if (__instance.HasStatusEffect<AyaEvasionSe>() && (int)((DamageInfo)(ref info)).DamageType == 2 && MathExtensions.Round(((DamageInfo)(ref info)).Damage, MidpointRounding.AwayFromZero) > 0f && !((DamageInfo)(ref info)).IsAccuracy)
					{
						DamageInfo val = new DamageInfo(0f, ((DamageInfo)(ref info)).DamageType, true, ((DamageInfo)(ref info)).IsAccuracy, false);
						val = ((DamageInfo)(ref val)).BlockBy(__instance.Block);
						__result = ((DamageInfo)(ref val)).ShieldBy(__instance.Shield);
						return false;
					}
					return true;
				}
			}

			[HarmonyPatch(typeof(Unit), "TakeDamage")]
			private class Unit_TakeDamage_Patch
			{
				private static void Postfix(Unit __instance, ref DamageInfo info)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Invalid comparison between Unknown and I4
					if ((int)((DamageInfo)(ref info)).DamageType == 2 && __instance.HasStatusEffect<AyaEvasionSe>())
					{
						if (((DamageInfo)(ref info)).IsGrazed)
						{
							__instance.GetStatusEffect<AyaEvasionSe>().Activate();
						}
						else if (((DamageInfo)(ref info)).IsAccuracy)
						{
							__instance.GetStatusEffect<AyaEvasionSe>().BeenAccurate();
						}
					}
				}
			}

			public override string UnitEffectName => "GrazeLoop";

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).HandleOwnerEvent<UnitEventArgs>(((StatusEffect)this).Owner.TurnStarted, (GameEventHandler<UnitEventArgs>)OnOwnerTurnStarted);
			}

			private void OnOwnerTurnStarted(UnitEventArgs args)
			{
				//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ac: Expected O, but got Unknown
				if ((((StatusEffect)this).Owner.HasStatusEffect<AyaAccelerationSeDef.AyaAccelerationSe>() && (double)((StatusEffect)this).Level <= Math.Truncate((double)((StatusEffect)((StatusEffect)this).Owner.GetStatusEffect<AyaAccelerationSeDef.AyaAccelerationSe>()).Level / 4.0)) || (((StatusEffect)this).Owner.HasStatusEffect<SuperExtraTurn>() && ((StatusEffect)this).Owner.GetStatusEffect<SuperExtraTurn>().IsInExtraTurnByThis))
				{
					return;
				}
				if (((StatusEffect)this).IsAutoDecreasing)
				{
					int level = ((StatusEffect)this).Level;
					((StatusEffect)this).Level = level - 1;
					if (((StatusEffect)this).Level <= 0)
					{
						((GameEntity)this).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f)));
					}
				}
				else
				{
					((StatusEffect)this).IsAutoDecreasing = true;
				}
			}

			public void Activate()
			{
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				int level = ((StatusEffect)this).Level;
				((StatusEffect)this).Level = level - 1;
				if (((StatusEffect)this).Level > 0)
				{
					((StatusEffect)this).NotifyActivating();
				}
				else
				{
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f)));
				}
			}

			public void BeenAccurate()
			{
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Expected O, but got Unknown
				int level = ((StatusEffect)this).Level;
				((StatusEffect)this).Level = level - 1;
				if (((StatusEffect)this).Level <= 0)
				{
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f)));
				}
			}
		}

		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("AyaEvasionSe");
		}

		public override LocalizationOption LoadLocalization()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GlobalLocalization val = new GlobalLocalization((IResourceSource)(object)BepinexPlugin.directorySource);
			val.DiscoverAndLoadLocFiles((EntityDefinition)(object)this);
			return (LocalizationOption)(object)val;
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("Resources.AyaEvasionSe.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
		}

		public override StatusEffectConfig MakeConfig()
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(StatusEffectConfig)), "", 1, (StatusEffectType)0, false, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)(StackType)0, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Graze", "Default", "Graze");
		}
	}
	public sealed class AyaPassiveSeDef : StatusEffectTemplate
	{
		[EntityLogic(typeof(AyaPassiveSeDef))]
		public sealed class AyaPassiveSe : StatusEffect
		{
			[HarmonyPatch(typeof(Card), "LocalizeProperty")]
			private class Card_LocalizeProperty_Patch
			{
				private static bool Prefix(Card __instance, ref string key, ref bool decorated, ref bool required, ref string __result)
				{
					if (((GameEntity)__instance).Id == "AyaNews" && key == "Description" && Singleton<GameMaster>.Instance.CurrentGameRun != null && (((Unit)Singleton<GameMaster>.Instance.CurrentGameRun.Player).HasStatusEffect<AyaPassiveSe>() || Singleton<GameMaster>.Instance.CurrentGameRun.Player.HasExhibit<AyaGDef.AyaG>() || Singleton<GameMaster>.Instance.CurrentGameRun.Player.HasExhibit<AyaRDef.AyaR>()))
					{
						__result = TypeFactory<Card>.LocalizeProperty("AyaNewsSpecial", "AyaNewsDescription", decorated, required);
						return false;
					}
					return true;
				}
			}

			public int Value => 12;

			protected override void OnAdded(Unit unit)
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: 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_009f: Invalid comparison between Unknown and I4
				CardConfig.FromId("AyaNews").Damage = Value;
				CardConfig.FromId("AyaNews").TargetType = (TargetType)1;
				if (!((Enum)CardConfig.FromId("AyaNews").Keywords).HasFlag((Enum)(object)(Keyword)8388608))
				{
					CardConfig obj = CardConfig.FromId("AyaNews");
					obj.Keywords = (Keyword)(obj.Keywords + 8388608);
				}
				foreach (Card item in ((StatusEffect)this).Battle.EnumerateAllCards())
				{
					if ((int)item.CardType == 7)
					{
						item.IsReplenish = true;
					}
				}
				((StatusEffect)this).HandleOwnerEvent<CardsEventArgs>(((StatusEffect)this).Battle.CardsAddedToDiscard, (GameEventHandler<CardsEventArgs>)OnAddCard);
				((StatusEffect)this).HandleOwnerEvent<CardsEventArgs>(((StatusEffect)this).Battle.CardsAddedToHand, (GameEventHandler<CardsEventArgs>)OnAddCard);
				((StatusEffect)this).HandleOwnerEvent<CardsEventArgs>(((StatusEffect)this).Battle.CardsAddedToExile, (GameEventHandler<CardsEventArgs>)OnAddCard);
				((StatusEffect)this).HandleOwnerEvent<CardsAddingToDrawZoneEventArgs>(((StatusEffect)this).Battle.CardsAddedToDrawZone, (GameEventHandler<CardsAddingToDrawZoneEventArgs>)OnAddCardToDraw);
				((StatusEffect)this).ReactOwnerEvent<StatusEffectEventArgs>(((Unit)((StatusEffect)this).Battle.Player).StatusEffectRemoving, (EventSequencedReactor<StatusEffectEventArgs>)OnPlayerStatusEffectRemoving);
			}

			private void OnAddCard(CardsEventArgs args)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Invalid comparison between Unknown and I4
				Card[] cards = args.Cards;
				foreach (Card val in cards)
				{
					if ((int)val.CardType == 7)
					{
						val.IsReplenish = true;
					}
				}
			}

			private void OnAddCardToDraw(CardsAddingToDrawZoneEventArgs args)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Invalid comparison between Unknown and I4
				Card[] cards = args.Cards;
				foreach (Card val in cards)
				{
					if ((int)val.CardType == 7)
					{
						val.IsReplenish = true;
					}
				}
			}

			private IEnumerable<BattleAction> OnPlayerStatusEffectRemoving(StatusEffectEventArgs args)
			{
				if (args.Effect == this)
				{
					((GameEventArgs)args).ForceCancelBecause((CancelCause)4096);
				}
				yield break;
			}

			protected override void OnRemoved(Unit unit)
			{
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				CardConfig.FromId("AyaNews").Damage = 1;
				CardConfig.FromId("AyaNews").TargetType = (TargetType)3;
				if (((Enum)CardConfig.FromId("AyaNews").Keywords).HasFlag((Enum)(object)(Keyword)8388608))
				{
					CardConfig obj = CardConfig.FromId("AyaNews");
					obj.Keywords = (Keyword)(obj.Keywords - 8388608);
				}
			}
		}

		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("AyaPassiveSe");
		}

		public override LocalizationOption LoadLocalization()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GlobalLocalization val = new GlobalLocalization((IResourceSource)(object)BepinexPlugin.directorySource);
			val.DiscoverAndLoadLocFiles((EntityDefinition)(object)this);
			return (LocalizationOption)(object)val;
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("Resources.AyaPassiveSe.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
		}

		public override StatusEffectConfig MakeConfig()
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(StatusEffectConfig)), "", -2, (StatusEffectType)2, false, true, (int?)null, false, (StackType?)(StackType)0, false, (StackType?)(StackType)0, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)8388608, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class AyaPerfectEvasionSeDef : StatusEffectTemplate
	{
		[EntityLogic(typeof(AyaPerfectEvasionSeDef))]
		public sealed class AyaPerfectEvasionSe : StatusEffect
		{
			[HarmonyPatch(typeof(Unit), "MeasureDamage")]
			private class Unit_MeasureDamage_Patch
			{
				private static bool Prefix(Unit __instance, ref DamageInfo info, ref DamageInfo __result)
				{
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0010: Invalid comparison between Unknown and I4
					//IL_003a: 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_004c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0055: Unknown result type (might be due to invalid IL or missing references)
					//IL_005a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0063: Unknown result type (might be due to invalid IL or missing references)
					//IL_0068: Unknown result type (might be due to invalid IL or missing references)
					if (__instance.HasStatusEffect<AyaPerfectEvasionSe>() && (int)((DamageInfo)(ref info)).DamageType == 2 && MathExtensions.Round(((DamageInfo)(ref info)).Damage, MidpointRounding.AwayFromZero) > 0f && ((DamageInfo)(ref info)).IsAccuracy)
					{
						DamageInfo val = new DamageInfo(0f, ((DamageInfo)(ref info)).DamageType, true, ((DamageInfo)(ref info)).IsAccuracy, false);
						val = ((DamageInfo)(ref val)).BlockBy(__instance.Block);
						__result = ((DamageInfo)(ref val)).ShieldBy(__instance.Shield);
						return false;
					}
					return true;
				}
			}

			[HarmonyPatch(typeof(Unit), "TakeDamage")]
			private class Unit_TakeDamage_Patch
			{
				private static int CheckGraze(Unit unit)
				{
					return unit.HasStatusEffect<Graze>() ? 2 : (-1);
				}

				private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
				{
					//IL_0003: 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_0027: Expected O, but got Unknown
					//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a6: Expected O, but got Unknown
					//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00ec: Expected O, but got Unknown
					return new CodeMatcher(instructions, generator).MatchForward(true, (CodeMatch[])(object)new CodeMatch[5]
					{
						new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"Taking grazed accurary DamageInfo {0}.", (string)null),
						CodeMatch.op_Implicit(OpCodes.Ldarg_1),
						CodeMatch.op_Implicit(OpCodes.Box),
						CodeMatch.op_Implicit(OpCodes.Call),
						CodeMatch.op_Implicit(OpCodes.Call)
					}).Set(OpCodes.Pop, (object)null).MatchForward(true, (CodeMatch[])(object)new CodeMatch[3]
					{
						CodeMatch.op_Implicit(OpCodes.Ldarga_S),
						new CodeMatch((OpCode?)OpCodes.Call, (object)AccessTools.PropertyGetter(typeof(DamageInfo), "DamageType"), (string)null),
						CodeMatch.op_Implicit(OpCodes.Ldc_I4_2)
					})
						.Set(OpCodes.Call, (object)AccessTools.Method(typeof(Unit_TakeDamage_Patch), "CheckGraze", (Type[])null, (Type[])null))
						.Insert((CodeInstruction[])(object)new CodeInstruction[1]
						{
							new CodeInstruction(OpCodes.Ldarg_0, (object)null)
						})
						.InstructionEnumeration();
				}

				private static void Postfix(Unit __instance, ref DamageInfo info)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Invalid comparison between Unknown and I4
					if ((int)((DamageInfo)(ref info)).DamageType == 2 && __instance.HasStatusEffect<AyaPerfectEvasionSe>() && ((DamageInfo)(ref info)).IsGrazed && ((DamageInfo)(ref info)).IsAccuracy)
					{
						__instance.GetStatusEffect<AyaPerfectEvasionSe>().Activate();
					}
				}
			}

			public override string UnitEffectName => "GrazeLoop";

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).HandleOwnerEvent<UnitEventArgs>(((StatusEffect)this).Owner.TurnStarted, (GameEventHandler<UnitEventArgs>)OnOwnerTurnStarted);
			}

			private void OnOwnerTurnStarted(UnitEventArgs args)
			{
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Expected O, but got Unknown
				if (((StatusEffect)this).Owner.HasStatusEffect<SuperExtraTurn>() && ((StatusEffect)this).Owner.GetStatusEffect<SuperExtraTurn>().IsInExtraTurnByThis)
				{
					return;
				}
				if (((StatusEffect)this).IsAutoDecreasing)
				{
					int level = ((StatusEffect)this).Level;
					((StatusEffect)this).Level = level - 1;
					if (((StatusEffect)this).Level == 0)
					{
						((GameEntity)this).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f)));
					}
				}
				else
				{
					((StatusEffect)this).IsAutoDecreasing = true;
				}
			}

			public void Activate()
			{
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				int level = ((StatusEffect)this).Level;
				((StatusEffect)this).Level = level - 1;
				if (((StatusEffect)this).Level > 0)
				{
					((StatusEffect)this).NotifyActivating();
				}
				else
				{
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f)));
				}
			}
		}

		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("AyaPerfectEvasionSe");
		}

		public override LocalizationOption LoadLocalization()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GlobalLocalization val = new GlobalLocalization((IResourceSource)(object)BepinexPlugin.directorySource);
			val.DiscoverAndLoadLocFiles((EntityDefinition)(object)this);
			return (LocalizationOption)(object)val;
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("Resources.AyaPerfectEvasionSe.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
		}

		public override StatusEffectConfig MakeConfig()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(StatusEffectConfig)), "", 0, (StatusEffectType)0, false, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)(StackType)0, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)256, (IReadOnlyList<string>)new List<string>(), "Graze", "Default", "Graze");
		}
	}
}
namespace AyaShameimaru.PlayerUnits
{
	public sealed class AyaPlayerUnitDef : PlayerUnitTemplate
	{
		[EntityLogic(typeof(AyaPlayerUnitDef))]
		public sealed class AyaPlayerUnit : PlayerUnit
		{
			[HarmonyPatch(typeof(AmuletForCard), "ExileCard")]
			private class AmuletForCard_ExileCard_Patch
			{
				private static bool Prefix(AmuletForCard __instance, ref IEnumerable<Card> cards)
				{
					//IL_00af: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b9: Expected O, but got Unknown
					//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
					//IL_0108: Expected O, but got Unknown
					GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
					if (((currentGameRun != null) ? currentGameRun.Player : null) is AyaPlayerUnit)
					{
						List<Card> list = cards.Where((Card card) => (int)card.CardType == 7 && !((GameEntity)card).DebugName.Contains("News")).ToList();
						if (list.Count == 0)
						{
							return false;
						}
						if (((StatusEffect)__instance).Level < list.Count)
						{
							list.RemoveRange(((StatusEffect)__instance).Level, list.Count - ((StatusEffect)__instance).Level);
						}
						((StatusEffect)__instance).NotifyActivating();
						Singleton<GameMaster>.Instance.CurrentGameRun.Battle.React(Reactor.op_Implicit((BattleAction)new ExileManyCardAction((IEnumerable<Card>)list)), (GameEntity)(object)__instance, (ActionCause)7);
						((StatusEffect)__instance).Level = ((StatusEffect)__instance).Level - list.Count;
						if (((StatusEffect)__instance).Level <= 0)
						{
							Singleton<GameMaster>.Instance.CurrentGameRun.Battle.React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)__instance, true, 0.1f)), (GameEntity)(object)__instance, (ActionCause)7);
						}
						return false;
					}
					return true;
				}
			}

			[HarmonyPatch(typeof(SihunYuSe), "OnOwnerTurnEnded")]
			private class SihunYuSe_OnOwnerTurnEnded_Patch
			{
				private static bool Prefix(SihunYuSe __instance)
				{
					if (FinalBossSequence >= 3)
					{
						return false;
					}
					return true;
				}
			}

			[HarmonyPatch(typeof(Stage), "GetBossCardReward")]
			private class Stage_GetBossCardReward_Patch
			{
				private static void Postfix(Stage __instance, StationReward __result)
				{
					//IL_0075: Unknown result type (might be due to invalid IL or missing references)
					//IL_007a: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
					//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
					//IL_0159: Unknown result type (might be due to invalid IL or missing references)
					//IL_015e: Unknown result type (might be due to invalid IL or missing references)
					if (!(Singleton<GameMaster>.Instance.CurrentGameRun.Player is AyaPlayerUnit) || (!Singleton<GameMaster>.Instance.CurrentGameRun.Player.HasExhibit<AyaTanukisLeafDef.AyaTanukisLeaf>() && Singleton<GameMaster>.Instance.CurrentGameRun.StationRng.NextInt(0, 5) != 5))
					{
						return;
					}
					List<Card> list = new List<Card>();
					Card momiji = (Card)(object)Library.CreateCard<AyaFriendMomiji>();
					ManaGroup baseMana = Singleton<GameMaster>.Instance.CurrentGameRun.BaseMana;
					if ((((ManaGroup)(ref baseMana)).Red > 0 || Singleton<GameMaster>.Instance.CurrentGameRun.RewardAndShopCardColorLimitFlag > 0) && !Singleton<GameMaster>.Instance.CurrentGameRun.BaseDeck.Any((Card c) => ((GameEntity)c).Id == ((GameEntity)momiji).Id))
					{
						list.Add(momiji);
					}
					Card megumu = (Card)(object)Library.CreateCard<AyaFriendMegumu>();
					baseMana = Singleton<GameMaster>.Instance.CurrentGameRun.BaseMana;
					if ((((ManaGroup)(ref baseMana)).Blue > 0 || Singleton<GameMaster>.Instance.CurrentGameRun.RewardAndShopCardColorLimitFlag > 0) && !Singleton<GameMaster>.Instance.CurrentGameRun.BaseDeck.Any((Card c) => ((GameEntity)c).Id == ((GameEntity)megumu).Id))
					{
						list.Add(megumu);
					}
					Card hatate = (Card)(object)Library.CreateCard<AyaFriendHatate>();
					baseMana = Singleton<GameMaster>.Instance.CurrentGameRun.BaseMana;
					if ((((ManaGroup)(ref baseMana)).Black > 0 || Singleton<GameMaster>.Instance.CurrentGameRun.RewardAndShopCardColorLimitFlag > 0) && !Singleton<GameMaster>.Instance.CurrentGameRun.BaseDeck.Any((Card c) => ((GameEntity)c).Id == ((GameEntity)hatate).Id))
					{
						list.Add(hatate);
					}
					if (CollectionsExtensions.NotEmpty<Card>((IReadOnlyCollection<Card>)list))
					{
						Card item = ((IEnumerable<Card>)__result.Cards).FirstOrDefault((Func<Card, bool>)((Card c) => c is AyaFriendMomiji || c is AyaFriendMegumu || c is AyaFriendHatate)) ?? __result.Cards.First();
						__result.Cards.Remove(item);
						__result.Cards.Add(CollectionsExtensions.Sample<Card>((IEnumerable<Card>)list, Singleton<GameMaster>.Instance.CurrentGameRun.CardRng));
					}
				}
			}

			[HarmonyPatch(typeof(UiManager), "LeaveGameRun")]
			private class UiManager_LeaveGameRun_Patch
			{
				private static void Postfix(UiManager __instance)
				{
					background.SetActive(false);
				}
			}

			public static int FinalBossSequence = 0;

			public static EnemyUnit FinalBoss = null;

			public static List<Card> FinalBossKeyCards = new List<Card>();

			public static bool FinalBossTransition = false;

			private static GameObject background = StageTemplate.TryGetEnvObject("AyaBackgroundTransition", (Assembly)null);

			private bool AyaIntro = false;

			private bool CirnoLeaved = false;

			private bool LastEnemy = false;

			public string AyaTanukiIntro1AyaTanuki => ((GameEntity)this).LocalizeProperty("AyaTanukiIntro1AyaTanuki", true, true);

			public string AyaTanukiIntro2Aya => ((GameEntity)this).LocalizeProperty("AyaTanukiIntro2Aya", true, true);

			public string AyaTanukiIntro3Aya => ((GameEntity)this).LocalizeProperty("AyaTanukiIntro3Aya", true, true);

			public string AyaTanukiIntro4AyaTanuki => ((GameEntity)this).LocalizeProperty("AyaTanukiIntro4AyaTanuki", true, true);

			public string SeijaPhase11Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase11Seija", true, true);

			public string SeijaPhase12Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase12Aya", true, true);

			public string SeijaPhase13Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase13Aya", true, true);

			public string SeijaPhase14Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase14Seija", true, true);

			public string SeijaPhase15Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase15Seija", true, true);

			public string SeijaPhase16Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase16Aya", true, true);

			public string SeijaPhase2Hidden1Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase2Hidden1Aya", true, true);

			public string SeijaPhase2Hidden2Koishi => ((GameEntity)this).LocalizeProperty("SeijaPhase2Hidden2Koishi", true, true);

			public string SeijaPhase21Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase21Seija", true, true);

			public string SeijaPhase22Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase22Seija", true, true);

			public string SeijaPhase23Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase23Aya", true, true);

			public string SeijaPhase24Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase24Seija", true, true);

			public string SeijaPhase25Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase25Seija", true, true);

			public string SeijaPhase26Reimu => ((GameEntity)this).LocalizeProperty("SeijaPhase26Reimu", true, true);

			public string SeijaPhase27Marisa => ((GameEntity)this).LocalizeProperty("SeijaPhase27Marisa", true, true);

			public string SeijaPhase28Sakuya => ((GameEntity)this).LocalizeProperty("SeijaPhase28Sakuya", true, true);

			public string SeijaPhase29Cirno => ((GameEntity)this).LocalizeProperty("SeijaPhase29Cirno", true, true);

			public string SeijaPhase210Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase210Seija", true, true);

			public string SeijaPhase211Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase211Aya", true, true);

			public string SeijaPhase212Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase212Seija", true, true);

			public string SeijaPhase213Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase213Aya", true, true);

			public string SeijaPhase214Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase214Seija", true, true);

			public string SeijaPhase215Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase215Aya", true, true);

			public string SeijaPhase216Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase216Aya", true, true);

			public string SeijaPhase217Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase217Aya", true, true);

			public string SeijaPhase3Normal1Cirno => ((GameEntity)this).LocalizeProperty("SeijaPhase3Normal1Cirno", true, true);

			public string SeijaPhase3True1Cirno => ((GameEntity)this).LocalizeProperty("SeijaPhase3True1Cirno", true, true);

			public string SeijaPhase3True2Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase3True2Aya", true, true);

			public string SeijaPhase3True3Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase3True3Aya", true, true);

			public string SeijaPhase3True4Cirno => ((GameEntity)this).LocalizeProperty("SeijaPhase3True4Cirno", true, true);

			public string SeijaPhase3True5Cirno => ((GameEntity)this).LocalizeProperty("SeijaPhase3True5Cirno", true, true);

			public string SeijaPhase3True6Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase3True6Aya", true, true);

			public string SeijaPhase3True7Cirno => ((GameEntity)this).LocalizeProperty("SeijaPhase3True7Cirno", true, true);

			public string SeijaPhase3True8Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase3True8Aya", true, true);

			public string SeijaPhase31Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase31Seija", true, true);

			public string SeijaPhase32Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase32Megumu", true, true);

			public string SeijaPhase33Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase33Seija", true, true);

			public string SeijaPhase34Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase34Seija", true, true);

			public string SeijaPhase35Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase35Megumu", true, true);

			public string SeijaPhase36Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase36Megumu", true, true);

			public string SeijaPhase37Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase37Megumu", true, true);

			public string SeijaPhase38Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase38Seija", true, true);

			public string SeijaPhase39Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase39Seija", true, true);

			public string SeijaPhase310Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase310Seija", true, true);

			public string SeijaPhase311Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase311Seija", true, true);

			public string SeijaPhase312Seija => ((GameEntity)this).LocalizeProperty("SeijaPhase312Seija", true, true);

			public string SeijaPhase3Normal2Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3Normal2Megumu", true, true);

			public string SeijaPhase3Normal3Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3Normal3Megumu", true, true);

			public string SeijaPhase3Normal4Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3Normal4Megumu", true, true);

			public string SeijaPhase3True9Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3True9Megumu", true, true);

			public string SeijaPhase3True10Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3True10Megumu", true, true);

			public string SeijaPhase3True11Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase3True11Aya", true, true);

			public string SeijaPhase3True12Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3True12Megumu", true, true);

			public string SeijaPhase3True13Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase3True13Aya", true, true);

			public string SeijaPhase3True14Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3True14Megumu", true, true);

			public string SeijaPhase3True15Aya => ((GameEntity)this).LocalizeProperty("SeijaPhase3True15Aya", true, true);

			public string SeijaPhase3True16Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3True16Megumu", true, true);

			public string SeijaPhase3True17Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3True17Megumu", true, true);

			public string SeijaPhase3True18Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3True18Megumu", true, true);

			public string SeijaPhase3True19Megumu => ((GameEntity)this).LocalizeProperty("SeijaPhase3True19Megumu", true, true);

			public string SeijaPhase3True20Okina => ((GameEntity)this).LocalizeProperty("SeijaPhase3True20Okina", true, true);

			protected override void OnEnterGameRun(GameRunController gameRun)
			{
				((Unit)this).HandleGameRunEvent<StationEventArgs>(((GameEntity)this).GameRun.StationEntered, (GameEventHandler<StationEventArgs>)delegate
				{
					//IL_0013: Unknown result type (might be due to invalid IL or missing references)
					UnitView view = ((Unit)this).GetView<UnitView>();
					if (view == null || ((Component)view).transform.localPosition.x != 0f)
					{
						((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(Return());
					}
				});
			}

			private IEnumerator Return()
			{
				TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMove(((Component)((Unit)this).GetView<UnitView>()).transform, new Vector3(-10f, 0f), 0f, false), (Ease)6), true), true));
				yield return (object)new WaitUntil((Func<bool>)(() => ((Component)((Unit)this).GetView<UnitView>()).transform.localPosition.x == -10f));
				TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMove(((Component)((Unit)this).GetView<UnitView>()).transform, new Vector3(0f, 0f), 1.25f, false), (Ease)6), true), true));
			}

			protected override void OnEnterBattle(BattleController battle)
			{
				FinalBossSequence = 0;
				((Unit)this).ReactBattleEvent<GameEventArgs>(((Unit)this).Battle.BattleStarted, (Func<GameEventArgs, IEnumerable<BattleAction>>)OnBattleStarted);
				((Unit)this).ReactBattleEvent<CardsEventArgs>(((Unit)this).Battle.CardsAddingToDiscard, (Func<CardsEventArgs, IEnumerable<BattleAction>>)OnCardsAddingToDiscard);
				((Unit)this).ReactBattleEvent<CardsEventArgs>(((Unit)this).Battle.CardsAddingToHand, (Func<CardsEventArgs, IEnumerable<BattleAction>>)OnCardsAddingToHand);
				((Unit)this).ReactBattleEvent<CardsEventArgs>(((Unit)this).Battle.CardsAddingToExile, (Func<CardsEventArgs, IEnumerable<BattleAction>>)OnCardsAddingToExile);
				((Unit)this).ReactBattleEvent<CardsAddingToDrawZoneEventArgs>(((Unit)this).Battle.CardsAddingToDrawZone, (Func<CardsAddingToDrawZoneEventArgs, IEnumerable<BattleAction>>)OnCardsAddingToDrawZone);
			}

			private IEnumerable<BattleAction> OnBattleStarted(GameEventArgs arg)
			{
				yield return (BattleAction)new ApplyStatusEffectAction(typeof(AyaPassiveSeDef.AyaPassiveSe), (Unit)(object)this, (int?)null, (int?)null, (int?)null, (int?)null, 0f, true);
				if (((GameEntity)this).GameRun.Battle.EnemyGroup.Id == "Aya")
				{
					((Unit)this).ReactBattleEvent<GameEventArgs>(((Unit)this).Battle.RoundStarting, (Func<GameEventArgs, IEnumerable<BattleAction>>)AyaRoundStarting);
				}
				Card Momiji = ((IEnumerable<Card>)((Unit)this).Battle.DrawZone).FirstOrDefault((Func<Card, bool>)((Card card) => card is AyaFriendMomiji));
				Card Megumu = ((IEnumerable<Card>)((Unit)this).Battle.DrawZone).FirstOrDefault((Func<Card, bool>)((Card card) => card is AyaFriendMegumu));
				Card Hatate = ((IEnumerable<Card>)((Unit)this).Battle.DrawZone).FirstOrDefault((Func<Card, bool>)((Card card) => card is AyaFriendHatate));
				if (Momiji != null && Megumu != null && Hatate != null && ((GameEntity)this).GameRun.Battle.EnemyGroup.Id == "Seija")
				{
					FinalBossSequence = 1;
					FinalBossKeyCards.Add(Momiji);
					FinalBossKeyCards.Add(Megumu);
					FinalBossKeyCards.Add(Hatate);
					FinalBoss = ((GameEntity)this).GameRun.Battle.AllAliveEnemies.First((EnemyUnit e) => e is Seija);
					AyaAdventoftheDivineGrandson.MusicChanged = true;
					BgmConfig.FromID(IdContainer.op_Implicit(((EntityDefinition)new AyaFinalBossBgm()).UniqueId)).LoopStart = 68.4f;
					BgmConfig.FromID(IdContainer.op_Implicit(((EntityDefinition)new AyaFinalBossBgm()).UniqueId)).LoopEnd = 223.5f;
					AudioManager.PlayInLayer1("AyaFinalBossBgm");
					((Unit)this).ReactBattleEvent<UnitEventArgs>(((Unit)((Unit)this).Battle.Player).TurnEnded, (Func<UnitEventArgs, IEnumerable<BattleAction>>)FinalBossPlayerTurnEnded);
					((Unit)this).ReactBattleEvent<DieEventArgs>(((Unit)((Unit)this).Battle.Player).Dying, (Func<DieEventArgs, IEnumerable<BattleAction>>)FinalBossPlayerDying);
					((Unit)this).ReactBattleEvent<GameEventArgs>(((Unit)this).Battle.AllEnemyTurnStarting, (Func<GameEventArgs, IEnumerable<BattleAction>>)FinalBossAllEnemyTurnStarting);
					((Unit)this).ReactBattleEvent<GameEventArgs>(((Unit)this).Battle.AllEnemyTurnEnded, (Func<GameEventArgs, IEnumerable<BattleAction>>)FinalBossAllEnemyTurnEnded);
					((Unit)this).ReactBattleEvent<CardEventArgs>(((Unit)this).Battle.CardRemoving, (Func<CardEventArgs, IEnumerable<BattleAction>>)FinalBossCardRemoving);
					((Unit)this).ReactBattleEvent<CardTransformEventArgs>(((Unit)this).Battle.CardTransforming, (Func<CardTransformEventArgs, IEnumerable<BattleAction>>)FinalBossCardTransforming);
					((Unit)this).ReactBattleEvent<UnitEventArgs>(((Unit)this).Battle.EnemySpawned, (Func<UnitEventArgs, IEnumerable<BattleAction>>)FinalBossEnemySpawned);
					((Unit)this).ReactBattleEvent<DieEventArgs>(((Unit)this).Battle.EnemyDied, (Func<DieEventArgs, IEnumerable<BattleAction>>)FinalBossEnemyDied);
					((Unit)this).ReactBattleEvent<DieEventArgs>(((Unit)FinalBoss).Dying, (Func<DieEventArgs, IEnumerable<BattleAction>>)FinalBossDying);
				}
			}

			private IEnumerable<BattleAction> AyaRoundStarting(GameEventArgs arg)
			{
				if (!AyaIntro)
				{
					AyaIntro = true;
					EnemyUnit ayaFake = ((GameEntity)this).GameRun.Battle.AllAliveEnemies.First((EnemyUnit e) => e is Aya);
					yield return (BattleAction)new DamageAction((Unit)(object)this, (Unit)(object)ayaFake, DamageInfo.HpLose(10f, false), "鸦天狗触发", (GunType)0);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)ayaFake, AyaTanukiIntro1AyaTanuki, 2f, 0f, 0f, true);
					((Unit)ayaFake).GetView<UnitView>()._statusWidget.FadeOut();
					((Unit)ayaFake).GetView<UnitView>().Escape();
					yield return (BattleAction)new SpawnEnemyAction(ayaFake, typeof(AyaTanuki), ayaFake.RootIndex, 0f, 0f, false);
					AudioManager.PlayInLayer1("AyaTanukiBgm");
					EnemyUnit limao = ((GameEntity)this).GameRun.Battle.AllAliveEnemies.First((EnemyUnit e) => e is AyaTanuki);
					yield return (BattleAction)(object)PerformAction.Effect((Unit)(object)limao, "Bianshen", 0f, (string)null, 0f, (EffectBehavior)0, 0f);
					yield return (BattleAction)(object)PerformAction.Sfx("Graze", 0f);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<AyaTanukiWindGodGrillSeDef.AyaTanukiWindGodGrillSe>((Unit)(object)limao, (int?)limao.Count1, (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)(object)PerformAction.Wait(1.5f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, AyaTanukiIntro2Aya, 2.5f, 0f, 2f, true);
					yield return (BattleAction)new EscapeAction((Unit)(object)ayaFake);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<AyaArmoredRavenSeDef.AyaArmoredRavenSe>((Unit)(object)this, (int?)1, (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, AyaTanukiIntro3Aya, 2f, 0f, 2f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)((GameEntity)this).GameRun.Battle.AllAliveEnemies.First((EnemyUnit e) => e is AyaTanuki), AyaTanukiIntro4AyaTanuki, 1.5f, 0f, 0.5f, true);
				}
			}

			private IEnumerable<BattleAction> OnCardsAddingToDiscard(CardsEventArgs arg)
			{
				if (((GameEventArgs)arg).ActionSource == this || !arg.Cards.Any((Card card) => card is AyaNewsReimuSp))
				{
					yield break;
				}
				List<Card> cards = new List<Card>();
				Card[] cards2 = arg.Cards;
				foreach (Card card2 in cards2)
				{
					if (card2 is AyaNewsReimuSp)
					{
						cards.Add((Card)(object)Library.CreateCard<AyaNewsAyaPlayerUnitSpDef.AyaNewsAyaPlayerUnitSp>());
					}
					else
					{
						cards.Add(card2);
					}
				}
				((GameEventArgs)arg).CancelBy((GameEntity)(object)this);
				yield return (BattleAction)new AddCardsToDiscardAction((IEnumerable<Card>)cards, (AddCardsType)0);
			}

			private IEnumerable<BattleAction> OnCardsAddingToHand(CardsEventArgs arg)
			{
				if (((GameEventArgs)arg).ActionSource == this || !arg.Cards.Any((Card card) => card is AyaNewsReimuSp))
				{
					yield break;
				}
				List<Card> cards = new List<Card>();
				Card[] cards2 = arg.Cards;
				foreach (Card card2 in cards2)
				{
					if (card2 is AyaNewsReimuSp)
					{
						cards.Add((Card)(object)Library.CreateCard<AyaNewsAyaPlayerUnitSpDef.AyaNewsAyaPlayerUnitSp>());
					}
					else
					{
						cards.Add(card2);
					}
				}
				((GameEventArgs)arg).CancelBy((GameEntity)(object)this);
				yield return (BattleAction)new AddCardsToHandAction((IEnumerable<Card>)cards, (AddCardsType)0);
			}

			private IEnumerable<BattleAction> OnCardsAddingToExile(CardsEventArgs arg)
			{
				if (((GameEventArgs)arg).ActionSource == this || !arg.Cards.Any((Card card) => card is AyaNewsReimuSp))
				{
					yield break;
				}
				List<Card> cards = new List<Card>();
				Card[] cards2 = arg.Cards;
				foreach (Card card2 in cards2)
				{
					if (card2 is AyaNewsReimuSp)
					{
						cards.Add((Card)(object)Library.CreateCard<AyaNewsAyaPlayerUnitSpDef.AyaNewsAyaPlayerUnitSp>());
					}
					else
					{
						cards.Add(card2);
					}
				}
				((GameEventArgs)arg).CancelBy((GameEntity)(object)this);
				yield return (BattleAction)new AddCardsToExileAction((IEnumerable<Card>)cards);
			}

			private IEnumerable<BattleAction> OnCardsAddingToDrawZone(CardsAddingToDrawZoneEventArgs arg)
			{
				if (((GameEventArgs)arg).ActionSource == this || !arg.Cards.Any((Card card) => card is AyaNewsReimuSp))
				{
					yield break;
				}
				List<Card> cards = new List<Card>();
				Card[] cards2 = arg.Cards;
				foreach (Card card2 in cards2)
				{
					if (card2 is AyaNewsReimuSp)
					{
						cards.Add((Card)(object)Library.CreateCard<AyaNewsAyaPlayerUnitSpDef.AyaNewsAyaPlayerUnitSp>());
					}
					else
					{
						cards.Add(card2);
					}
				}
				((GameEventArgs)arg).CancelBy((GameEntity)(object)this);
				yield return (BattleAction)new AddCardsToDrawZoneAction((IEnumerable<Card>)cards, arg.DrawZoneTarget, (AddCardsType)0);
			}

			private IEnumerable<BattleAction> FinalBossPlayerTurnEnded(UnitEventArgs arg)
			{
				if (FinalBossSequence == 1 && ((Unit)FinalBoss).Hp < 500)
				{
					FinalBossSequence = 2;
					BgmConfig.FromID(IdContainer.op_Implicit(((EntityDefinition)new AyaFinalBossBgm()).UniqueId)).LoopStart = 277.9f;
					BgmConfig.FromID(IdContainer.op_Implicit(((EntityDefinition)new AyaFinalBossBgm()).UniqueId)).LoopEnd = 447.35f;
					AudioManager.FadeOutAndPlayBgm("AyaFinalBossBgm", 0f, 0f, 227.175f, false);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase11Seija, 2.5f, 0f, 2.5f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase12Aya, 2.5f, 0f, 2.5f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase13Aya, 1.5f, 0f, 0.75f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase14Seija, 2.5f, 0f, 1.75f, true);
					yield return (BattleAction)(object)PerformAction.Wait(0.75f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase15Seija, 2.5f, 0f, 2.5f, true);
					yield return (BattleAction)(object)PerformAction.Spell((Unit)(object)FinalBoss, "逆转攻势");
					yield return (BattleAction)(object)PerformAction.Animation((Unit)(object)FinalBoss, "spell", 1f, (string)null, 0f, -1);
					yield return (BattleAction)new HealAction((Unit)(object)FinalBoss, (Unit)(object)FinalBoss, ((Unit)FinalBoss).MaxHp, (HealType)0, 0.2f);
					EnemyUnit finalBoss = FinalBoss;
					Seija seija = (Seija)(object)((finalBoss is Seija) ? finalBoss : null);
					seija._pool.Clear();
					if (!((Unit)seija).HasStatusEffect<ShendengSe>())
					{
						yield return (BattleAction)(object)new ApplyStatusEffectAction<ShendengSe>((Unit)(object)seija, (int?)3, (int?)null, (int?)null, (int?)null, 0.2f, true);
					}
					if (!((Unit)seija).HasStatusEffect<HolyGrailSe>())
					{
						yield return (BattleAction)(object)new ApplyStatusEffectAction<HolyGrailSe>((Unit)(object)seija, (int?)null, (int?)null, (int?)null, (int?)null, 0.2f, true);
					}
					if (!((Unit)seija).HasStatusEffect<SihunYuSe>())
					{
						yield return (BattleAction)(object)new ApplyStatusEffectAction<SihunYuSe>((Unit)(object)seija, (int?)null, (int?)null, (int?)null, (int?)null, 0.2f, true);
					}
					if (!((Unit)seija).HasStatusEffect<MadokaBowSe>())
					{
						yield return (BattleAction)(object)new ApplyStatusEffectAction<MadokaBowSe>((Unit)(object)seija, (int?)2, (int?)null, (int?)null, (int?)null, 0.2f, true);
					}
					if (!((Unit)seija).HasStatusEffect<QiannianShenqiSe>())
					{
						yield return (BattleAction)(object)new ApplyStatusEffectAction<QiannianShenqiSe>((Unit)(object)seija, (int?)null, (int?)null, (int?)null, (int?)10, 0.2f, true);
					}
					if (!((Unit)seija).HasStatusEffect<InfinityGemsSe>())
					{
						yield return (BattleAction)(object)new ApplyStatusEffectAction<InfinityGemsSe>((Unit)(object)seija, (int?)null, (int?)null, (int?)null, (int?)null, 0.2f, true);
					}
					if (!((Unit)seija).HasStatusEffect<SakuraWandSe>())
					{
						yield return (BattleAction)(object)new ApplyStatusEffectAction<SakuraWandSe>((Unit)(object)seija, (int?)null, (int?)null, (int?)null, (int?)null, 0.2f, true);
					}
					yield return (BattleAction)(object)new ApplyStatusEffectAction<GuangxueMicai>((Unit)(object)seija, (int?)null, (int?)999, (int?)null, (int?)null, 0.2f, true);
					seija.ItemCount = 6;
					seija.BigRoundCount = 6;
					seija.LastType = typeof(SakuraWandSe).Name;
					((EnemyUnit)seija)._turnMoves.Clear();
					((EnemyUnit)seija).ClearIntentions();
					((EnemyUnit)seija).NotifyIntentionsChanged();
					seija.Next = (MoveType)0;
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase16Aya, 2.5f, 0f, 2.5f, true);
				}
				else if (FinalBossSequence == 2 && ((Unit)this).Battle.BattleShouldEnd)
				{
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase2Hidden1Aya, 5f, 0f, 5f, true);
					TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<Sequence>(TweenSettingsExtensions.SetUpdate<Sequence>(TweenSettingsExtensions.SetEase<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)ShortcutExtensions.DOScaleX(((Component)((Unit)this).GetView<UnitView>()).transform, -1f, 0.25f)), (Tween)(object)ShortcutExtensions.DOLocalMoveX(((Component)((Unit)this).GetView<UnitView>()).transform, -12f, 5f, false)), (Ease)1), true), true));
					yield return (BattleAction)(object)PerformAction.Wait(4f, true);
					yield return (BattleAction)new SpawnEnemyAction((EnemyUnit)null, typeof(Koishi), 4, 0f, 0.3f, false);
					yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)((Unit)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Koishi)).GetStatusEffect<MirrorImage>(), true, 0f);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Koishi), SeijaPhase2Hidden2Koishi, 2f, 0f, 2f, true);
					((Unit)this).Battle.InstantWin();
				}
				else
				{
					if (FinalBossSequence != 6)
					{
						yield break;
					}
					FinalBossSequence = 7;
					if (((Unit)this).Battle.HandZone.Any((Card c) => c is AyaFriendCirno))
					{
						EnemyUnit megumu2 = ((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is AyaAllyLong);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<Sequence>(TweenSettingsExtensions.SetUpdate<Sequence>(TweenSettingsExtensions.SetEase<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)ShortcutExtensions.DOScaleX(((Component)((Unit)this).GetView<UnitView>()).transform, -1f, 0.25f)), (Tween)(object)ShortcutExtensions.DOLocalMoveX(((Component)((Unit)this).GetView<UnitView>()).transform, 0f, 5f, false)), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True9Megumu, 2.5f, 0f, 2.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True10Megumu, 2.5f, 0f, 2f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True11Aya, 2.5f, 0f, 1.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True12Megumu, 1f, 0f, 1f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True13Aya, 3f, 0f, 3f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True14Megumu, 2.5f, 0f, 2.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True15Aya, 2.5f, 0f, 2.5f, true);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMoveX(((Component)((Unit)this).GetView<UnitView>()).transform, -12f, 5f, false), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Wait(0.5f, true);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<Sequence>(TweenSettingsExtensions.SetUpdate<Sequence>(TweenSettingsExtensions.SetEase<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)ShortcutExtensions.DOScaleX(((Component)((Unit)megumu2).GetView<UnitView>()).transform, 1f, 0.2f)), (Tween)(object)ShortcutExtensions.DOLocalMoveX(((Component)((Unit)megumu2).GetView<UnitView>()).transform, -11f, 1f, false)), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Wait(2f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True16Megumu, 1.5f, 0f, 1.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True17Megumu, 3.5f, 0f, 3.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True18Megumu, 3f, 0f, 3f, true);
						yield return (BattleAction)(object)PerformAction.Effect((Unit)(object)megumu2, "BuffFirepower", 0f, "Firepower", 0f, (EffectBehavior)0, 0f);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True19Megumu, 2.5f, 0f, 2.5f, true);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMoveX(((Component)((Unit)megumu2).GetView<UnitView>()).transform, -22f, 5f, false), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Wait(3f, true);
						yield return (BattleAction)new SpawnEnemyAction(megumu2, typeof(AyaPlayerUnitM), 0, 0f, 0.5f, false);
						yield return (BattleAction)new SpawnEnemyAction(megumu2, typeof(AyaPlayerUnitS), 1, 0f, 0.5f, false);
						yield return (BattleAction)new SpawnEnemyAction(megumu2, typeof(AyaPlayerUnitO), 2, 0f, 0.5f, false);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is AyaPlayerUnitO), SeijaPhase3True20Okina, 2.5f, 0f, 2.5f, true);
						((Unit)this).Battle.InstantWin();
					}
					else
					{
						EnemyUnit megumu = ((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is AyaAllyLong);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<Sequence>(TweenSettingsExtensions.SetUpdate<Sequence>(TweenSettingsExtensions.SetEase<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)ShortcutExtensions.DOScaleX(((Component)((Unit)this).GetView<UnitView>()).transform, -1f, 0.25f)), (Tween)(object)ShortcutExtensions.DOLocalMoveX(((Component)((Unit)this).GetView<UnitView>()).transform, -12f, 10f, false)), (Ease)1), true), true));
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMoveX(((Component)((Unit)megumu).GetView<UnitView>()).transform, -11f, 1f, false), (Ease)3), true), true));
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu, SeijaPhase3Normal2Megumu, 2.5f, 0f, 2.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu, SeijaPhase3Normal3Megumu, 2.5f, 0f, 3.5f, true);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<Sequence>(TweenSettingsExtensions.SetUpdate<Sequence>(TweenSettingsExtensions.SetEase<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)ShortcutExtensions.DOScaleX(((Component)((Unit)megumu).GetView<UnitView>()).transform, 1f, 0.25f)), (Tween)(object)ShortcutExtensions.DOLocalMoveX(((Component)((Unit)megumu).GetView<UnitView>()).transform, -22f, 12f, false)), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu, SeijaPhase3Normal4Megumu, 2.5f, 0f, 2.5f, false);
						((Unit)this).Battle.InstantWin();
					}
				}
			}

			private IEnumerable<BattleAction> FinalBossPlayerDying(DieEventArgs arg)
			{
				if (FinalBossSequence == 2)
				{
					FinalBossTransition = true;
					((GameEntity)this).GameRun.SetHpAndMaxHp(1, 1, false);
					((GameEventArgs)arg).ForceCancelBecause((CancelCause)4096);
					((Unit)this).Status = (UnitStatus)0;
				}
				yield break;
			}

			private IEnumerable<BattleAction> FinalBossAllEnemyTurnStarting(GameEventArgs arg)
			{
				yield break;
			}

			private IEnumerable<BattleAction> FinalBossAllEnemyTurnEnded(GameEventArgs arg)
			{
				if (FinalBossTransition)
				{
					FinalBossTransition = false;
					FinalBossSequence = 3;
					foreach (EnemyUnit enemy in ((Unit)this).Battle.AllAliveEnemies)
					{
						if (enemy != FinalBoss)
						{
							yield return (BattleAction)new EscapeAction((Unit)(object)enemy);
						}
					}
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase21Seija, 2f, 0f, 2f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase22Seija, 2f, 0f, 2f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase23Aya, 3f, 0f, 2f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase24Seija, 2f, 0f, 2f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase25Seija, 2f, 0f, 2f, true);
					Vector2 defaultChat = UnitModelConfig.FromName("Reimu").Chat;
					UnitModelConfig.FromName("Reimu").Chat = new Vector2(0.4f, 0.4f);
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(Reimu), 0, 0f, 0f, false);
					yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)((Unit)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Reimu)).GetStatusEffect<MirrorImage>(), true, 0f);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Reimu), SeijaPhase26Reimu, 3f, 0f, 3f, true);
					UnitModelConfig.FromName("Reimu").Chat = defaultChat;
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(Marisa), 1, 0f, 0f, false);
					yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)((Unit)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Marisa)).GetStatusEffect<MirrorImage>(), true, 0f);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Marisa), SeijaPhase27Marisa, 3f, 0f, 3f, true);
					defaultChat = UnitModelConfig.FromName("Sakuya").Chat;
					UnitModelConfig.FromName("Sakuya").Chat = new Vector2(0.4f, 0.4f);
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(Sakuya), 3, 0f, 0f, false);
					yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)((Unit)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Sakuya)).GetStatusEffect<MirrorImage>(), true, 0f);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Sakuya), SeijaPhase28Sakuya, 3f, 0f, 3f, true);
					UnitModelConfig.FromName("Sakuya").Chat = defaultChat;
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(Cirno), 4, 0f, 0f, false);
					yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)((Unit)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Cirno)).GetStatusEffect<MirrorImage>(), true, 0f);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<AyaPlayerUnitBuddySeDef.AyaPlayerUnitBuddySe>((Unit)(object)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Cirno), (int?)null, (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Cirno), SeijaPhase29Cirno, 3f, 0f, 3f, true);
					yield return (BattleAction)new HealAction((Unit)(object)FinalBoss, (Unit)(object)FinalBoss, ((Unit)FinalBoss).MaxHp, (HealType)0, 0.2f);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase210Seija, 2f, 0f, 1f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase211Aya, 2f, 0f, 1f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase212Seija, 1.5f, 0f, 1.5f, true);
					yield return (BattleAction)(object)PerformAction.Gun((Unit)(object)this, (Unit)(object)FinalBoss, "JunkoLunatic", 0f);
					foreach (EnemyUnit enemy2 in ((Unit)this).Battle.AllAliveEnemies)
					{
						yield return (BattleAction)(object)PerformAction.Animation((Unit)(object)enemy2, "hit", 0f, (string)null, 0f, 10);
					}
					AudioManager.FadeOutBgm(0f);
					background.SetActive(true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase213Aya, 2f, 0f, 2f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase214Seija, 1f, 0f, 1f, true);
					List<Card> hands = ((Unit)this).Battle.HandZone.ToList();
					foreach (Card hand in hands)
					{
						yield return (BattleAction)new MoveCardAction(hand, (CardZone)4);
					}
					List<Card> keys = FinalBossKeyCards;
					foreach (Card key in keys)
					{
						if ((int)key.Zone != 5)
						{
							yield return (BattleAction)new ExileCardAction(key);
						}
					}
					Card momiji = keys.First((Card c) => c is AyaFriendMomiji);
					if ((int)momiji.Zone != 2)
					{
						yield return (BattleAction)new MoveCardAction(momiji, (CardZone)2);
					}
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase215Aya, 4f, 0f, 4f, true);
					Card megumu3 = keys.First((Card c) => c is AyaFriendMegumu);
					if ((int)megumu3.Zone != 2)
					{
						yield return (BattleAction)new MoveCardAction(megumu3, (CardZone)2);
					}
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase216Aya, 4f, 0f, 4f, true);
					Card hatate = keys.First((Card c) => c is AyaFriendHatate);
					if ((int)hatate.Zone != 2)
					{
						yield return (BattleAction)new MoveCardAction(hatate, (CardZone)2);
					}
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase217Aya, 4f, 0f, 4f, true);
					foreach (Card key2 in keys)
					{
						if (key2.Battle != null)
						{
							yield return (BattleAction)new RemoveCardAction(key2);
							continue;
						}
						key2.EnterBattle(((Unit)this).Battle);
						yield return (BattleAction)new RemoveCardAction(key2);
					}
					List<Exhibit> ayaExhibits = new List<Exhibit>
					{
						(Exhibit)(object)Library.CreateExhibit<AyaRDef.AyaR>(),
						(Exhibit)(object)Library.CreateExhibit<AyaGDef.AyaG>()
					};
					foreach (Exhibit exhibit in ayaExhibits.Where((Exhibit e) => !((GameEntity)this).GameRun.Player.HasExhibit(((GameEntity)e).Id)))
					{
						((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(((GameEntity)this).GameRun.GainExhibitRunner(exhibit, false, (VisualSourceData)null));
					}
					Card card = (Card)(object)Library.CreateCard<AyaFriendAya>();
					int maxHand = ((Unit)this).Battle.MaxHand;
					((Unit)this).Battle.MaxHand = 99;
					yield return (BattleAction)new AddCardsToHandAction((Card[])(object)new Card[1] { card });
					((Unit)this).Battle.MaxHand = maxHand;
					yield return (BattleAction)(object)CardHelper.AutoCastAction(card, UnitSelector.Nobody, ManaGroup.Philosophies(7), true);
					background.SetActive(false);
					EnemyUnit finalBoss = FinalBoss;
					Seija seija = (Seija)(object)((finalBoss is Seija) ? finalBoss : null);
					seija.ItemCount = 8;
					seija.BigRoundCount = 8;
					if (((Unit)seija).HasStatusEffect<DragonBallSe>())
					{
						yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)((Unit)seija).GetStatusEffect<DragonBallSe>(), true, 0.1f);
					}
				}
				else if (FinalBossSequence == 3 && Singleton<GameMaster>.Instance.CurrentGameRun.Battle.AllAliveEnemies.Count() == 1)
				{
					FinalBossSequence = 4;
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(Tianzi), 0, 0f, 0.3f, false);
					EnemyUnit tianzi = ((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Tianzi);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<FlatPeach>((Unit)(object)tianzi, (int?)tianzi.Count1, (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<EnemyEnergy>((Unit)(object)tianzi, (int?)0, (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<GuangxueMicai>((Unit)(object)tianzi, (int?)null, (int?)999, (int?)null, (int?)null, 0.2f, true);
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(Yuyuko), 1, 0f, 0.3f, false);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<GuangxueMicai>((Unit)(object)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Yuyuko), (int?)null, (int?)999, (int?)null, (int?)null, 0.2f, true);
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(AyaAllyLong), 4, 0f, 0.3f, false);
				}
				else if (FinalBossSequence == 4 && Singleton<GameMaster>.Instance.CurrentGameRun.Battle.AllAliveEnemies.Count() == 2)
				{
					FinalBossSequence = 5;
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(Sanae), 0, 0f, 0.3f, false);
					EnemyUnit sanae = ((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Sanae);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<Curiosity>((Unit)(object)sanae, (int?)(((int)sanae.Difficulty != 3) ? 1 : 2), (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<Amulet>((Unit)(object)sanae, (int?)3, (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<GuangxueMicai>((Unit)(object)sanae, (int?)null, (int?)999, (int?)null, (int?)null, 0.2f, true);
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(Remilia), 1, 0f, 0.3f, false);
					EnemyUnit remilia = ((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Remilia);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<ScarletDestiny>((Unit)(object)remilia, (int?)null, (int?)null, (int?)null, (int?)remilia.Count2, 0f, true);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<Graze>((Unit)(object)remilia, (int?)3, (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<GuangxueMicai>((Unit)(object)remilia, (int?)null, (int?)999, (int?)null, (int?)null, 0.2f, true);
					yield return (BattleAction)new SpawnEnemyAction(FinalBoss, typeof(Junko), 3, 0f, 0.3f, false);
					Junko junko = (Junko)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Junko);
					yield return (BattleAction)(object)new ApplyStatusEffectAction<JunkoPurify>((Unit)(object)junko, (int?)1, (int?)null, (int?)null, (int?)null, 0f, true);
					junko._junkoColorLevel = 1;
					yield return (BattleAction)(object)new ApplyStatusEffectAction<JunkoColor>((Unit)(object)this, (int?)1, (int?)null, (int?)0, (int?)null, 0f, true);
					junko.Next = (MoveType)1;
					((EnemyUnit)junko).CountDown = 2;
					yield return (BattleAction)(object)new ApplyStatusEffectAction<GuangxueMicai>((Unit)(object)junko, (int?)null, (int?)999, (int?)null, (int?)null, 0.2f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase38Seija, 2f, 0f, 2f, true);
				}
				else
				{
					if (FinalBossSequence != 6)
					{
						yield break;
					}
					FinalBossSequence = 7;
					if (((Unit)this).Battle.HandZone.Any((Card c) => c is AyaFriendCirno))
					{
						EnemyUnit megumu2 = ((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is AyaAllyLong);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<Sequence>(TweenSettingsExtensions.SetUpdate<Sequence>(TweenSettingsExtensions.SetEase<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)ShortcutExtensions.DOScaleX(((Component)((Unit)this).GetView<UnitView>()).transform, -1f, 0.25f)), (Tween)(object)ShortcutExtensions.DOLocalMoveX(((Component)((Unit)this).GetView<UnitView>()).transform, 0f, 5f, false)), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True9Megumu, 2.5f, 0f, 2.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True10Megumu, 2.5f, 0f, 2f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True11Aya, 2.5f, 0f, 1.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True12Megumu, 1f, 0f, 1f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True13Aya, 3f, 0f, 3f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True14Megumu, 2.5f, 0f, 2.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True15Aya, 2.5f, 0f, 2.5f, true);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMoveX(((Component)((Unit)this).GetView<UnitView>()).transform, -12f, 5f, false), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Wait(0.5f, true);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<Sequence>(TweenSettingsExtensions.SetUpdate<Sequence>(TweenSettingsExtensions.SetEase<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)ShortcutExtensions.DOScaleX(((Component)((Unit)megumu2).GetView<UnitView>()).transform, 1f, 0.2f)), (Tween)(object)ShortcutExtensions.DOLocalMoveX(((Component)((Unit)megumu2).GetView<UnitView>()).transform, -11f, 1f, false)), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Wait(2f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True16Megumu, 1.5f, 0f, 1.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True17Megumu, 3.5f, 0f, 3.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True18Megumu, 3f, 0f, 3f, true);
						yield return (BattleAction)(object)PerformAction.Effect((Unit)(object)megumu2, "BuffFirepower", 0f, "Firepower", 0f, (EffectBehavior)0, 0f);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu2, SeijaPhase3True19Megumu, 2.5f, 0f, 2.5f, true);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMoveX(((Component)((Unit)megumu2).GetView<UnitView>()).transform, -22f, 5f, false), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Wait(3f, true);
						yield return (BattleAction)new SpawnEnemyAction(megumu2, typeof(AyaPlayerUnitM), 0, 0f, 0.5f, false);
						yield return (BattleAction)new SpawnEnemyAction(megumu2, typeof(AyaPlayerUnitS), 1, 0f, 0.5f, false);
						yield return (BattleAction)new SpawnEnemyAction(megumu2, typeof(AyaPlayerUnitO), 2, 0f, 0.5f, false);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is AyaPlayerUnitO), SeijaPhase3True20Okina, 2.5f, 0f, 2.5f, true);
						((Unit)this).Battle.InstantWin();
					}
					else
					{
						EnemyUnit megumu = ((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is AyaAllyLong);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<Sequence>(TweenSettingsExtensions.SetUpdate<Sequence>(TweenSettingsExtensions.SetEase<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)ShortcutExtensions.DOScaleX(((Component)((Unit)this).GetView<UnitView>()).transform, -1f, 0.25f)), (Tween)(object)ShortcutExtensions.DOLocalMoveX(((Component)((Unit)this).GetView<UnitView>()).transform, -12f, 10f, false)), (Ease)1), true), true));
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMoveX(((Component)((Unit)megumu).GetView<UnitView>()).transform, -11f, 1f, false), (Ease)3), true), true));
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu, SeijaPhase3Normal2Megumu, 2.5f, 0f, 2.5f, true);
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu, SeijaPhase3Normal3Megumu, 2.5f, 0f, 3.5f, true);
						TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<Sequence>(TweenSettingsExtensions.SetUpdate<Sequence>(TweenSettingsExtensions.SetEase<Sequence>(TweenSettingsExtensions.Append(TweenSettingsExtensions.Append(DOTween.Sequence(), (Tween)(object)ShortcutExtensions.DOScaleX(((Component)((Unit)megumu).GetView<UnitView>()).transform, 1f, 0.25f)), (Tween)(object)ShortcutExtensions.DOLocalMoveX(((Component)((Unit)megumu).GetView<UnitView>()).transform, -22f, 12f, false)), (Ease)1), true), true));
						yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)megumu, SeijaPhase3Normal4Megumu, 2.5f, 0f, 2.5f, false);
						((Unit)this).Battle.InstantWin();
					}
				}
			}

			private IEnumerable<BattleAction> FinalBossCardRemoving(CardEventArgs arg)
			{
				if (FinalBossSequence < 3 && FinalBossKeyCards.Contains(arg.Card))
				{
					((GameEventArgs)arg).ForceCancelBecause((CancelCause)4096);
					yield return (BattleAction)new ExileCardAction(arg.Card);
				}
			}

			private IEnumerable<BattleAction> FinalBossCardTransforming(CardTransformEventArgs arg)
			{
				if (FinalBossSequence < 3 && FinalBossKeyCards.Contains(arg.SourceCard))
				{
					((GameEventArgs)arg).ForceCancelBecause((CancelCause)4096);
					yield return (BattleAction)new ExileCardAction(arg.SourceCard);
				}
			}

			private IEnumerable<BattleAction> FinalBossEnemySpawned(UnitEventArgs args)
			{
				if (args.Unit is AyaAllyLong)
				{
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase31Seija, 2.5f, 0f, 2.5f, true);
					yield return (BattleAction)(object)PerformAction.Chat(args.Unit, SeijaPhase32Megumu, 1.5f, 0f, 1.5f, true);
					TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMoveX(((Component)args.Unit.GetView<UnitView>()).transform, -12f, 3f, false), (Ease)3), true), true));
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase33Seija, 1.5f, 0f, 1.5f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase34Seija, 1.5f, 0f, 1f, true);
					TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOScaleX(((Component)args.Unit.GetView<UnitView>()).transform, -1f, 0.25f), (Ease)3), true), true));
					yield return (BattleAction)(object)PerformAction.Chat(args.Unit, SeijaPhase35Megumu, 3f, 0f, 3f, true);
					yield return (BattleAction)(object)PerformAction.Chat(args.Unit, SeijaPhase36Megumu, 3f, 0f, 3f, true);
					yield return (BattleAction)(object)PerformAction.Chat(args.Unit, SeijaPhase37Megumu, 3f, 0f, 3f, true);
				}
				else if (args.Unit is Cirno)
				{
					((Unit)this).ReactBattleEvent<DieEventArgs>(args.Unit.Dying, (Func<DieEventArgs, IEnumerable<BattleAction>>)FinalBossCirnoDying);
					((Unit)this).ReactBattleEvent<DieEventArgs>(((Unit)this).Battle.EnemyDied, (Func<DieEventArgs, IEnumerable<BattleAction>>)FinalBossCirnoLived);
				}
			}

			private IEnumerable<BattleAction> FinalBossCirnoDying(DieEventArgs arg)
			{
				CirnoLeaved = true;
				yield return (BattleAction)(object)PerformAction.Chat(arg.Unit, SeijaPhase3Normal1Cirno, 2.5f, 0f, 0f, true);
			}

			private IEnumerable<BattleAction> FinalBossCirnoLived(DieEventArgs arg)
			{
				if (CirnoLeaved || ((Unit)this).Battle.AllAliveEnemies.Count() != 2)
				{
					yield break;
				}
				CirnoLeaved = true;
				EnemyUnit cirno = ((Unit)this).Battle.AllAliveEnemies.First((EnemyUnit e) => e is Cirno);
				TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMove(((Component)((Unit)cirno).GetView<UnitView>()).transform, new Vector3(-8f, 1.5f), 4f, false), (Ease)3), true), true));
				yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)cirno, SeijaPhase3True1Cirno, 1.75f, 0f, 1f, true);
				yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True2Aya, 3f, 0f, 3f, true);
				yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True3Aya, 3f, 0f, 3f, true);
				yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)cirno, SeijaPhase3True4Cirno, 1.5f, 0f, 3f, true);
				yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)cirno, SeijaPhase3True5Cirno, 2.5f, 0f, 2.5f, true);
				yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True6Aya, 2f, 0f, 2f, true);
				if (((Unit)cirno).HasStatusEffect<AyaPlayerUnitBuddySeDef.AyaPlayerUnitBuddySe>())
				{
					yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)((Unit)cirno).GetStatusEffect<AyaPlayerUnitBuddySeDef.AyaPlayerUnitBuddySe>(), true, 0f);
				}
				List<Exhibit> cirnoExhibits = new List<Exhibit>
				{
					(Exhibit)(object)Library.CreateExhibit<CirnoU>(),
					(Exhibit)(object)Library.CreateExhibit<CirnoG>()
				};
				foreach (Exhibit exhibit in cirnoExhibits.Where((Exhibit e) => !((GameEntity)this).GameRun.Player.HasExhibit(((GameEntity)e).Id)))
				{
					((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(((GameEntity)this).GameRun.GainExhibitRunner(exhibit, false, (VisualSourceData)null));
				}
				Card card = (Card)(object)Library.CreateCard<AyaFriendCirno>();
				int maxHand = ((Unit)this).Battle.MaxHand;
				((Unit)this).Battle.MaxHand = 99;
				yield return (BattleAction)new AddCardsToHandAction((Card[])(object)new Card[1] { card });
				((Unit)this).Battle.MaxHand = maxHand;
				yield return (BattleAction)(object)CardHelper.AutoCastAction(card, UnitSelector.Nobody, ManaGroup.Philosophies(4), true);
				yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)cirno, SeijaPhase3True7Cirno, 2f, 0f, 2f, true);
				TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMove(((Component)((Unit)cirno).GetView<UnitView>()).transform, new Vector3(-17.5f, 1.5f), 2.2f, false), (Ease)1), true), true));
				yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)this, SeijaPhase3True8Aya, 2f, 0f, 2f, true);
				((Unit)cirno).GetView<UnitView>()._statusWidget.FadeOut();
				((Unit)cirno).GetView<UnitView>().Escape();
				yield return (BattleAction)new EscapeAction((Unit)(object)cirno);
			}

			private IEnumerable<BattleAction> FinalBossEnemyDied(DieEventArgs arg)
			{
				List<Card> cards = new List<Card>();
				switch (((GameEntity)arg.Unit).Id)
				{
				case "Reimu":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<HuanxiangTouying>(),
						(Card)(object)Library.CreateCard<Jiangshen>()
					};
					break;
				case "Marisa":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<SolarSystem>(),
						(Card)(object)Library.CreateCard<SolarSystem>()
					};
					break;
				case "Sakuya":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<SakuyaFuneral>(),
						(Card)(object)Library.CreateCard<SakuyaFuneral>()
					};
					break;
				case "Cirno":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<DeepFreeze>(),
						(Card)(object)Library.CreateCard<WhiteWorld>()
					};
					break;
				case "AyaAllyLong":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<TiangouOrder>(),
						(Card)(object)Library.CreateCard<RainbowMarket>()
					};
					break;
				case "Tianzi":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<TianziRock>(),
						(Card)(object)Library.CreateCard<TianziMana>()
					};
					break;
				case "Yuyuko":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<YuyukoDebuff>(),
						(Card)(object)Library.CreateCard<YuyukoSing>()
					};
					break;
				case "Sanae":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<SanaeMiracle>(),
						(Card)(object)Library.CreateCard<SanaeRestart>()
					};
					break;
				case "Remilia":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<RemiliaFate>(),
						(Card)(object)Library.CreateCard<RemiliaBat>()
					};
					break;
				case "Junko":
					cards = new List<Card>
					{
						(Card)(object)Library.CreateCard<PatchouliLibrary>(),
						(Card)(object)Library.CreateCard<JunkoNightmare>()
					};
					break;
				}
				if (cards != null)
				{
					foreach (Card card in cards)
					{
						if (!card.CanUpgrade)
						{
							continue;
						}
						if (card is YuyukoSing)
						{
							for (int i = 0; i < 9; i++)
							{
								card.Upgrade();
							}
						}
						else
						{
							card.Upgrade();
						}
					}
					yield return (BattleAction)new AddCardsToDrawZoneAction((IEnumerable<Card>)cards, (DrawZoneTarget)2, (AddCardsType)0);
				}
				if (FinalBossSequence == 5 && ((Unit)this).Battle.AllAliveEnemies.Count() == 2 && !LastEnemy)
				{
					LastEnemy = true;
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase39Seija, 1f, 0f, 1f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase310Seija, 1.5f, 0f, 1.5f, true);
				}
				if (FinalBossSequence == 6)
				{
					yield return (BattleAction)new RequestEndPlayerTurnAction();
				}
			}

			private IEnumerable<BattleAction> FinalBossDying(DieEventArgs arg)
			{
				if (FinalBossSequence == 3)
				{
					yield return (BattleAction)new HealAction((Unit)(object)FinalBoss, (Unit)(object)FinalBoss, 699 - ((Unit)FinalBoss).Hp, (HealType)0, 0.2f);
					((GameEventArgs)arg).CancelBy((GameEntity)(object)FinalBoss);
					((Unit)FinalBoss).Status = (UnitStatus)0;
				}
				else if (FinalBossSequence == 4)
				{
					yield return (BattleAction)new HealAction((Unit)(object)FinalBoss, (Unit)(object)FinalBoss, 399 - ((Unit)FinalBoss).Hp, (HealType)0, 0.2f);
					((GameEventArgs)arg).CancelBy((GameEntity)(object)FinalBoss);
					((Unit)FinalBoss).Status = (UnitStatus)0;
				}
				else
				{
					if (FinalBossSequence != 5)
					{
						yield break;
					}
					FinalBossSequence = 6;
					yield return (BattleAction)new EndShootAction((Unit)(object)this);
					foreach (EnemyUnit enemy in ((Unit)this).Battle.AllAliveEnemies.Where((EnemyUnit e) => !(e is Seija) && !(e is AyaAllyLong)))
					{
						yield return (BattleAction)new ForceKillAction((Unit)(object)enemy, (Unit)(object)enemy);
					}
					((GameEventArgs)arg).CancelBy((GameEntity)(object)FinalBoss);
					((Unit)FinalBoss).Status = (UnitStatus)0;
					((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(Cinematic());
					yield return (BattleAction)(object)PerformAction.Wait(1f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase311Seija, 2.5f, 0f, 2.5f, true);
					yield return (BattleAction)(object)PerformAction.Chat((Unit)(object)FinalBoss, SeijaPhase312Seija, 2.5f, 0f, 2.5f, true);
					while (((Component)((Unit)this).GetView<UnitView>()).transform.localPosition.x < 6.4f)
					{
						yield return (BattleAction)(object)PerformAction.Wait(0.05f, true);
					}
					yield return (BattleAction)(object)PerformAction.Animation((Unit)(object)this, "defend", 0f, (string)null, 0f, 10);
					yield return (BattleAction)(object)PerformAction.Animation((Unit)(object)FinalBoss, "hit", 0f, (string)null, 0f, 10);
					yield return (BattleAction)(object)PerformAction.Gun((Unit)(object)this, (Unit)(object)FinalBoss, "分解之风B", 0f);
					while (((Component)((Unit)FinalBoss).GetView<UnitView>()).transform.localPosition.x > -3.9f)
					{
						yield return (BattleAction)(object)PerformAction.Wait(0.05f, true);
					}
					AudioManager.FadeOutBgm(15f);
					yield return (BattleAction)new ForceKillAction((Unit)(object)FinalBoss, (Unit)(object)FinalBoss);
				}
			}

			private IEnumerator Cinematic()
			{
				TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<float, float, FloatOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<float, float, FloatOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<float, float, FloatOptions>>(ShortcutExtensions.DOOrthoSize(Camera.main, 2.5f, 6.5f), (Ease)1), true), true));
				TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMoveX(((Component)Camera.main).transform, 3f, 6.5f, false), (Ease)1), true), true));
				TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMoveX(((Component)((Unit)this).GetView<UnitView>()).transform, 6.5f, 6.5f, false), (Ease)1), true), true));
				yield return (object)new WaitUntil((Func<bool>)(() => ((Component)((Unit)this).GetView<UnitView>()).transform.localPosition.x == 6.5f));
				TweenExtensions.WaitForCompletion((Tween)(object)TweenSettingsExtensions.SetAutoKill<TweenerCore<float, float, FloatOptions>>(TweenSettingsExtensions.SetUpdate<TweenerCore<float, float, FloatOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<float, fl