Decompiled source of Mima v0.0.42

lvalonmima.dll

Decompiled 5 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Cysharp.Threading.Tasks;
using HarmonyLib;
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.Randoms;
using LBoL.Core.Stations;
using LBoL.Core.StatusEffects;
using LBoL.Core.Units;
using LBoL.EntityLib.Cards;
using LBoL.EntityLib.Exhibits;
using LBoL.EntityLib.StatusEffects.ExtraTurn;
using LBoL.EntityLib.StatusEffects.Neutral.TwoColor;
using LBoL.EntityLib.StatusEffects.Others;
using LBoL.EntityLib.StatusEffects.Reimu;
using LBoL.EntityLib.StatusEffects.Sakuya;
using LBoL.Presentation;
using LBoL.Presentation.UI;
using LBoL.Presentation.UI.Panels;
using LBoLEntitySideloader;
using LBoLEntitySideloader.Attributes;
using LBoLEntitySideloader.CustomHandlers;
using LBoLEntitySideloader.Entities;
using LBoLEntitySideloader.PersistentValues;
using LBoLEntitySideloader.Resource;
using LBoLEntitySideloader.Utils;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.UI;
using lvalonmima.NotImages.Blitz.Rare;
using lvalonmima.NotImages.Rare;
using lvalonmima.NotImages.Starter;
using lvalonmima.NotRelics;
using lvalonmima.SE;
using lvalonmima.SE.mburstmodifiers;

[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("lvalonmima")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("lvalonmima")]
[assembly: AssemblyTitle("lvalonmima")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace lvalonmima
{
	[BepInPlugin("llbol.ea.mima", "llvalonmima", "0.0.42")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInProcess("LBoL.exe")]
	public class BepinexPlugin : BaseUnityPlugin
	{
		private class CoroutineExtender : IEnumerable
		{
			public IEnumerator target_enumerator;

			public List<IEnumerator> preItems = new List<IEnumerator>();

			public List<IEnumerator> postItems = new List<IEnumerator>();

			public List<IEnumerator> midItems = new List<IEnumerator>();

			public CoroutineExtender()
			{
			}

			public CoroutineExtender(IEnumerator target_enumerator)
			{
				this.target_enumerator = target_enumerator;
			}

			public IEnumerator GetEnumerator()
			{
				foreach (IEnumerator preItem in preItems)
				{
					yield return preItem;
				}
				int i = 0;
				while (target_enumerator.MoveNext())
				{
					yield return target_enumerator.Current;
					i++;
				}
				foreach (IEnumerator postItem in postItems)
				{
					yield return postItem;
				}
			}
		}

		[HarmonyPatch(typeof(Exhibit), "TriggerGain")]
		[HarmonyDebug]
		private class Exhibit_Patch
		{
			private static void Postfix(ref IEnumerator __result)
			{
				CoroutineExtender coroutineExtender = new CoroutineExtender(__result);
				coroutineExtender.postItems.Add(mimaArmrf());
				__result = coroutineExtender.GetEnumerator();
			}

			private static IEnumerator mimaArmrf()
			{
				if ((Object)(object)Singleton<GameMaster>.Instance != (Object)null && Singleton<GameMaster>.Instance.CurrentGameRun != null)
				{
					GameRunController run = Singleton<GameMaster>.Instance.CurrentGameRun;
					Exhibit exhibit = (Exhibit)(object)run.Player.GetExhibit<mimaadef.mimaa>();
					int num;
					if (run.CurrentStation != null && (int)run.CurrentStation.Type == 10 && exhibit != null)
					{
						ManaGroup baseMana = run.BaseMana;
						num = ((((ManaGroup)(ref baseMana)).Colorless > 0) ? 1 : 0);
					}
					else
					{
						num = 0;
					}
					if (num != 0)
					{
						run.LoseBaseMana(ManaGroup.Colorlesses(1), false);
					}
				}
				yield break;
			}
		}

		public class mimaplayerdata : CustomGameRunSaveData
		{
			public bool haspassive;

			public int passivegold;

			public int passivepower;

			public int passivemb;

			public int passivembhand;

			public int passiveupgrade;

			public int passiveimplosion;

			public int passiveretribution;

			public int passiveeverlast;

			public int passivecharge;

			public override void Restore(GameRunController gameRun)
			{
				log.LogDebug((object)"bepinex restoring");
				PlayerUnit player = gameRun.Player;
				Exhibit exhibit = (Exhibit)(object)player.GetExhibit<mimapassivesdef.mimapassives>();
				if (exhibit != null && exhibit is mimapassivesdef.mimapassives mimapassives)
				{
					log.LogDebug((object)"restoring passives");
					mimapassives.haspassive = haspassive;
					mimapassives.passivegold = passivegold;
					mimapassives.passivepower = passivepower;
					mimapassives.passivemb = passivemb;
					mimapassives.passivembhand = passivembhand;
					mimapassives.passiveupgrade = passiveupgrade;
					mimapassives.passivecharge = passivecharge;
					mimapassives.passiveimplosion = passiveimplosion;
					mimapassives.passiveretribution = passiveretribution;
					mimapassives.passiveeverlast = passiveeverlast;
				}
				else
				{
					haspassive = false;
				}
			}

			public override void Save(GameRunController gameRun)
			{
				log.LogDebug((object)"bepinex saving");
				PlayerUnit player = gameRun.Player;
				Exhibit exhibit = (Exhibit)(object)player.GetExhibit<mimapassivesdef.mimapassives>();
				if (exhibit != null && exhibit is mimapassivesdef.mimapassives mimapassives)
				{
					log.LogDebug((object)"saving passives");
					haspassive = mimapassives.haspassive;
					passivegold = mimapassives.passivegold;
					passivepower = mimapassives.passivepower;
					passivemb = mimapassives.passivemb;
					passivembhand = mimapassives.passivembhand;
					passiveupgrade = mimapassives.passiveupgrade;
					passivecharge = mimapassives.passivecharge;
					passiveimplosion = mimapassives.passiveimplosion;
					passiveretribution = mimapassives.passiveretribution;
					passiveeverlast = mimapassives.passiveeverlast;
				}
				else
				{
					haspassive = false;
				}
			}
		}

		private static readonly Harmony harmony = PInfo.harmony;

		internal static ManualLogSource log;

		internal static TemplateSequenceTable sequenceTable = new TemplateSequenceTable(0);

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

		internal static DirectorySource directorySource = new DirectorySource("llbol.ea.mima", "");

		private static KeyboardShortcut TestTab = new KeyboardShortcut((KeyCode)9, Array.Empty<KeyCode>());

		public readonly Dictionary<string, Toggle> _characterFilterList = new Dictionary<string, Toggle>();

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

		internal static BatchLocalization cardbatchloc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(CardTemplate), "card", (Locale)0, false);

		internal static BatchLocalization sebatchloc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(StatusEffectTemplate), "SE", (Locale)0, false);

		internal static BatchLocalization exbatchloc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(ExhibitTemplate), "ex", (Locale)0, false);

		internal static BatchLocalization ultbatchloc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(UltimateSkillTemplate), "ult", (Locale)0, false);

		internal static BatchLocalization playerbatchloc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(PlayerUnitTemplate), "player", (Locale)0, false);

		internal static BatchLocalization modelbatchloc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(UnitModelTemplate), "model", (Locale)0, false);

		public static BepinexPlugin Instance;

		public IEnumerable<Type> FilterCardByCharacter()
		{
			List<Type> list = new List<Type>();
			string[] array = new string[1] { "Mima" };
			foreach (var (item, val) in Library.EnumerateCardTypes())
			{
				if (array.Length == 0)
				{
					list.Add(item);
				}
				if (array.Contains(val.Owner))
				{
					list.Add(item);
				}
				if (array.Contains("Neutral") && string.IsNullOrWhiteSpace(val.Owner))
				{
					list.Add(item);
				}
			}
			return list;
		}

		public bool initcardpool()
		{
			extradeck = new List<Card>();
			IEnumerable<Type> enumerable = FilterCardByCharacter();
			foreach (Type item2 in enumerable)
			{
				Card item = Library.CreateCard(item2);
				extradeck.Add(item);
			}
			return true;
		}

		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();
			CHandlerManager.RegisterGameEventHandler<CardsEventArgs>((EventProvider<CardsEventArgs, GameRunController>)((GameRunController gr) => gr.DeckCardsAdding), (GameEventHandler<CardsEventArgs>)CustomHandlers.OnDeckCardsAdding, (GameEventPriority)10);
			CHandlerManager.RegisterGameEventHandler<CardsEventArgs>((EventProvider<CardsEventArgs, GameRunController>)((GameRunController gr) => gr.DeckCardsAdded), (GameEventHandler<CardsEventArgs>)CustomHandlers.OnDeckCardsAdded, (GameEventPriority)10);
			((CustomGameRunSaveData)new mimaplayerdata()).RegisterSelf("llbol.ea.mima");
			CustomHandlers.addreactors();
			Instance = this;
			log.LogDebug((object)Application.persistentDataPath);
		}

		private void OnDestroy()
		{
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}

		private void Update()
		{
			GameMaster instance = Singleton<GameMaster>.Instance;
			GameRunController val = ((instance != null) ? instance.CurrentGameRun : null);
			if (val != null)
			{
				PlayerUnit player = val.Player;
				if (((KeyboardShortcut)(ref TestTab)).IsDown() && ((player.HasExhibit<mimabdef.mimab>() && val.Money >= 10 && val.CurrentStation.Level != 0) || ((GameEntity)val.CurrentStation.Stage).Id != "BambooForest"))
				{
					((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(tabberbase());
				}
			}
		}

		private IEnumerator tabberbase()
		{
			GameMaster instance = Singleton<GameMaster>.Instance;
			GameRunController gamerun = ((instance != null) ? instance.CurrentGameRun : null);
			if (gamerun == null)
			{
				yield break;
			}
			Exhibit exhibit = (Exhibit)(object)gamerun.Player.GetExhibit<mimabdef.mimab>();
			if (exhibit != null)
			{
				if (gamerun.Battle == null)
				{
					((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(shopplugin.shopCoroutinePassive());
				}
				else
				{
					((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(shopplugin.shopCoroutineBlitz());
				}
			}
		}
	}
	public class CustomHandlers
	{
		private static IEnumerator GainExhibits(GameRunController gameRun, HashSet<Type> exhibits, bool triggerVisual = false, VisualSourceData exhibitSource = null)
		{
			foreach (Type et in exhibits)
			{
				Exhibit ex = Library.CreateExhibit(et);
				((GameEntity)ex).GameRun = gameRun;
				yield return gameRun.GainExhibitRunner(ex, triggerVisual, exhibitSource);
			}
			gameRun.ExhibitPool.RemoveAll((Type e) => exhibits.Contains(e));
		}

		public static void OnDeckCardsAdding(CardsEventArgs args)
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Expected O, but got Unknown
			GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
			if (args.Cards.Count((Card card) => card is mimaextensions.mimacard mimacard && mimacard is mimaextensions.mimacard.passivecard) > 0 && !currentGameRun.Player.HasExhibit<mimapassivesdef.mimapassives>())
			{
				((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(GainExhibits(currentGameRun, new HashSet<Type> { typeof(mimapassivesdef.mimapassives) }, triggerVisual: true, new VisualSourceData
				{
					SourceType = (VisualSourceType)5,
					Source = null
				}));
			}
		}

		public static void OnDeckCardsAdded(CardsEventArgs args)
		{
			GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
			BattleController battle = currentGameRun.Battle;
			List<Card> list = new List<Card>();
			foreach (Card item in args.Cards.Where((Card c) => c is mimaextensions.mimacard.blitzcard))
			{
				string id = ((GameEntity)item).Id;
				string text = id;
				if (text == "blitzeburst" && currentGameRun.Battle != null)
				{
					blitzeburstdef.blitzeburst.onconfirm(item);
				}
			}
			List<Card> list2 = new List<Card>();
			foreach (Card libcard2 in currentGameRun.BaseDeck.Where((Card c) => !args.Cards.Any((Card ac) => ac == c) && c is mimaextensions.mimacard.monstercard))
			{
				if (!list2.Any((Card fcard) => ((GameEntity)fcard).Id == ((GameEntity)libcard2).Id))
				{
					list2.Add(libcard2);
				}
			}
			foreach (Card argc in args.Cards.Where((Card c) => c is mimaextensions.mimacard.monstercard))
			{
				if (!list2.Any((Card fcard) => ((GameEntity)fcard).Id == ((GameEntity)argc).Id))
				{
					list2.Add(argc);
				}
			}
			foreach (Card libcard in currentGameRun.BaseDeck.Where((Card c) => c is mimaextensions.mimacard.monstercard))
			{
				foreach (Card item2 in list2.Where((Card fcard) => ((GameEntity)fcard).Id == ((GameEntity)libcard).Id && fcard != libcard))
				{
					item2.Upgrade();
				}
				if (!list2.Any((Card c) => c == libcard))
				{
					list.Add(libcard);
				}
			}
			foreach (Card item3 in currentGameRun.BaseDeck.Where((Card c) => c is mimaextensions.mimacard.blitzcard))
			{
				list.Add(item3);
			}
			foreach (Card item4 in list)
			{
				currentGameRun.RemoveDeckCard(item4, true);
			}
		}

		public static void addreactors()
		{
			CHandlerManager.RegisterBattleEventHandler<GameEventArgs>((EventProvider<GameEventArgs, BattleController>)((BattleController b) => b.BattleStarting), (GameEventHandler<GameEventArgs>)addbattlereactor, (Predicate<BattleController>)null, (GameEventPriority)int.MinValue);
		}

		private static void addbattlereactor(GameEventArgs args)
		{
			PlayerUnit player = Singleton<GameMaster>.Instance.CurrentGameRun.Battle.Player;
			battlereactor((Unit)(object)player);
		}

		private static void battlereactor(Unit unit)
		{
			GameRunController gamerun = Singleton<GameMaster>.Instance.CurrentGameRun;
			unit.ReactBattleEvent<CardsEventArgs>(gamerun.Battle.CardsAddedToDiscard, (Func<CardsEventArgs, IEnumerable<BattleAction>>)((CardsEventArgs args) => battlefieldyeet(args)));
			unit.ReactBattleEvent<CardsEventArgs>(gamerun.Battle.CardsAddedToExile, (Func<CardsEventArgs, IEnumerable<BattleAction>>)((CardsEventArgs args) => battlefieldyeet(args)));
			unit.ReactBattleEvent<CardsEventArgs>(gamerun.Battle.CardsAddedToHand, (Func<CardsEventArgs, IEnumerable<BattleAction>>)((CardsEventArgs args) => battlefieldyeet(args)));
			unit.ReactBattleEvent<CardsEventArgs>(gamerun.Battle.CardsAddedToDiscard, (Func<CardsEventArgs, IEnumerable<BattleAction>>)((CardsEventArgs args) => battlefieldyeet(args)));
			unit.ReactBattleEvent<CardsAddingToDrawZoneEventArgs>(gamerun.Battle.CardsAddedToDrawZone, (Func<CardsAddingToDrawZoneEventArgs, IEnumerable<BattleAction>>)((CardsAddingToDrawZoneEventArgs args) => battlefieldyeet2(args)));
			unit.ReactBattleEvent<GameEventArgs>(gamerun.Battle.BattleEnded, (Func<GameEventArgs, IEnumerable<BattleAction>>)((GameEventArgs args) => rmvbbm(args)));
			IEnumerable<BattleAction> battlefieldyeet(CardsEventArgs args)
			{
				//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f1: Expected O, but got Unknown
				//IL_029e: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a8: Expected O, but got Unknown
				//IL_02da: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e4: Expected O, but got Unknown
				List<BattleAction> list5 = new List<BattleAction>();
				List<Card> list6 = new List<Card>();
				List<Card> list7 = new List<Card>();
				foreach (Card battlecard4 in from c in gamerun.Battle.EnumerateAllCards()
					where !args.Cards.Any((Card ac) => ac == c) && c is mimaextensions.mimacard.monstercard
					select c)
				{
					if (!list7.Any((Card fcard) => ((GameEntity)fcard).Id == ((GameEntity)battlecard4).Id))
					{
						list7.Add(battlecard4);
					}
				}
				foreach (Card argc2 in args.Cards.Where((Card c) => c is mimaextensions.mimacard.monstercard))
				{
					if (!list7.Any((Card fcard) => ((GameEntity)fcard).Id == ((GameEntity)argc2).Id))
					{
						list7.Add(argc2);
					}
				}
				foreach (Card battlecard3 in from c in gamerun.Battle.EnumerateAllCards()
					where c is mimaextensions.mimacard.monstercard
					select c)
				{
					foreach (Card item in list7.Where((Card fcard) => ((GameEntity)fcard).Id == ((GameEntity)battlecard3).Id && fcard != battlecard3))
					{
						list5.Add((BattleAction)new UpgradeCardAction(item));
					}
					if (!list7.Any((Card c) => c == battlecard3))
					{
						list6.Add(battlecard3);
					}
				}
				foreach (Card item2 in from c in gamerun.Battle.EnumerateAllCards()
					where c is mimaextensions.mimacard.blitzcard
					select c)
				{
					list5.Add((BattleAction)new RemoveCardAction(item2));
				}
				foreach (Card item3 in list6)
				{
					list5.Add((BattleAction)new RemoveCardAction(item3));
				}
				return list5;
			}
			IEnumerable<BattleAction> battlefieldyeet2(CardsAddingToDrawZoneEventArgs args)
			{
				//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f1: Expected O, but got Unknown
				//IL_029e: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a8: Expected O, but got Unknown
				//IL_02da: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e4: Expected O, but got Unknown
				List<BattleAction> list2 = new List<BattleAction>();
				List<Card> list3 = new List<Card>();
				List<Card> list4 = new List<Card>();
				foreach (Card battlecard2 in from c in gamerun.Battle.EnumerateAllCards()
					where !args.Cards.Any((Card ac) => ac == c) && c is mimaextensions.mimacard.monstercard
					select c)
				{
					if (!list4.Any((Card fcard) => ((GameEntity)fcard).Id == ((GameEntity)battlecard2).Id))
					{
						list4.Add(battlecard2);
					}
				}
				foreach (Card argc in args.Cards.Where((Card c) => c is mimaextensions.mimacard.monstercard))
				{
					if (!list4.Any((Card fcard) => ((GameEntity)fcard).Id == ((GameEntity)argc).Id))
					{
						list4.Add(argc);
					}
				}
				foreach (Card battlecard in from c in gamerun.Battle.EnumerateAllCards()
					where c is mimaextensions.mimacard.monstercard
					select c)
				{
					foreach (Card item4 in list4.Where((Card fcard) => ((GameEntity)fcard).Id == ((GameEntity)battlecard).Id && fcard != battlecard))
					{
						list2.Add((BattleAction)new UpgradeCardAction(item4));
					}
					if (!list4.Any((Card c) => c == battlecard))
					{
						list3.Add(battlecard);
					}
				}
				foreach (Card item5 in from c in gamerun.Battle.EnumerateAllCards()
					where c is mimaextensions.mimacard.blitzcard
					select c)
				{
					list2.Add((BattleAction)new RemoveCardAction(item5));
				}
				foreach (Card item6 in list3)
				{
					list2.Add((BattleAction)new RemoveCardAction(item6));
				}
				return list2;
			}
			List<BattleAction> rmvbbm(GameEventArgs args)
			{
				List<BattleAction> result = new List<BattleAction>();
				List<Card> list = new List<Card>();
				foreach (Card item7 in from c in gamerun.Battle.EnumerateAllCards()
					where c is mimaextensions.mimacard.blitzcard
					select c)
				{
					list.Add(item7);
				}
				foreach (Card item8 in list)
				{
					gamerun.RemoveDeckCard(item8, true);
				}
				return result;
			}
		}
	}
	public class mimaextensions
	{
		public abstract class mimacard : Card
		{
			public abstract class passivecard : mimacard
			{
			}

			public abstract class blitzcard : mimacard
			{
				public abstract class bmcard : blitzcard
				{
					public static readonly List<Card> bmlist;

					static bmcard()
					{
						List<Card> list = new List<Card> { (Card)(object)Library.CreateCard<blitzeburstdef.blitzeburst>() };
						bmlist = list;
					}
				}

				public static readonly List<Card> blitzlist;

				static blitzcard()
				{
					List<Card> list = new List<Card> { (Card)(object)Library.CreateCard<blitzeburstdef.blitzeburst>() };
					blitzlist = list;
				}
			}

			public abstract class monstercard : mimacard
			{
			}

			static mimacard()
			{
			}
		}

		public abstract class mimaoptioncard : OptionCard
		{
		}

		public abstract class mimaexhibit : Exhibit
		{
		}

		public abstract class mimasexhibit : ShiningExhibit
		{
		}

		public abstract class mimaexpartner : ExtraTurnPartner
		{
		}

		public abstract class mimase : StatusEffect
		{
			public static readonly List<string> MBmods;

			public int truecounter { get; set; }

			static mimase()
			{
				List<string> mBmods = new List<string> { "accumulation", "concentratedburst", "everlastingmagic", "fastburst", "retribution", "splitburst" };
				MBmods = mBmods;
			}
		}
	}
	public static class PInfo
	{
		public const string GUID = "llbol.ea.mima";

		public const string Name = "llvalonmima";

		public const string version = "0.0.42";

		public static readonly Harmony harmony = new Harmony("llbol.ea.mima");
	}
	public sealed class playermima : PlayerUnitTemplate
	{
		[EntityLogic(typeof(playermima))]
		public sealed class Mima : PlayerUnit
		{
		}

		public static DirectorySource dir = new DirectorySource("llbol.ea.mima", "");

		public static string name = "Mima";

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

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.playerbatchloc.AddEntity((EntityDefinition)(object)this);
		}

		public override PlayerImages LoadPlayerImages()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			PlayerImages val = new PlayerImages();
			val.AutoLoad("", (Func<string, Sprite>)((string s) => ResourceLoader.LoadSprite(s, (IResourceSource)(object)dir, 100, 1, (FilterMode)1, true, (Rect?)null, (Vector2?)null)), (Func<string, UniTask<Sprite>>)((string s) => ResourceLoader.LoadSpriteAsync(s, BepinexPlugin.directorySource, 100, (GraphicsFormat)4, 1, (FilterMode)1, (SpriteMeshType)1, (Rect?)null, (Vector2?)null, "file://")), (UseSame)2, ".png", "");
			return val;
		}

		public override PlayerUnitConfig MakeConfig()
		{
			//IL_0032: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			PlayerUnitConfig val = ObjectExtensions.Copy<PlayerUnitConfig>(PlayerUnitConfig.FromId("Reimu"));
			int? num = 10;
			ManaGroup val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Philosophy = 2;
			((ManaGroup)(ref val2)).Colorless = 2;
			return new PlayerUnitConfig("", int.MaxValue, 0, num, "", "#ffffff", true, 66, val2, 66, 0, "ulta", "ultb", "mimaa", "mimab", (IReadOnlyList<string>)new List<string> { "cardchannelling", "cardmountain", "cardmimaalib", "cardremini", "carderosion" }, (IReadOnlyList<string>)new List<string> { "cardmimablib" }, 6, 6);
		}
	}
	public sealed class mimamodel : UnitModelTemplate
	{
		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 ((EntityDefinition)new playermima()).UniqueId;
		}

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.modelbatchloc.AddEntity((EntityDefinition)(object)this);
		}

		public override ModelOption LoadModelOptions()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			return new ModelOption(ResourceLoader.LoadSpriteAsync("playermimasprite.png", BepinexPlugin.directorySource, 336, (GraphicsFormat)4, 1, (FilterMode)1, (SpriteMeshType)1, (Rect?)null, (Vector2?)null, "file://"));
		}

		public override UniTask<Sprite> LoadSpellSprite()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			return ResourceLoader.LoadSpriteAsync("playermimabomb.png", playermima.dir, 336, (GraphicsFormat)4, 1, (FilterMode)1, (SpriteMeshType)1, (Rect?)null, (Vector2?)null, "file://");
		}

		public override UnitModelConfig MakeConfig()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Expected O, but got Unknown
			return new UnitModelConfig("Mima", 0, (string)null, new Vector2(0f, -0.1f), true, 2, new Vector2(0.8f, 1.8f), 1.2f, 1.3f, new Vector2(0f, -1.3f), 666f, new Vector2(0f, 1.2f), new Vector2(1.6f, 2f), (IReadOnlyList<float>)new float[1] { 0.1f }, (IReadOnlyList<Vector2>)(object)new Vector2[1]
			{
				new Vector2(0.6f, 0.3f)
			}, (IReadOnlyList<Vector2>)(object)new Vector2[1]
			{
				new Vector2(0.6f, 0.3f)
			}, new Vector2(0.3f, 0f), 0.1f, 0.1f, new Vector2(0.4f, 0.8f), new Vector2(-0.8f, -0.58f), new Vector2(0.6f, 0.5f), true, new Vector2(400f, 0f), 0.9f, (IReadOnlyList<Color32>)(object)new Color32[4]
			{
				new Color32((byte)186, (byte)66, byte.MaxValue, byte.MaxValue),
				new Color32((byte)155, (byte)5, (byte)193, byte.MaxValue),
				new Color32((byte)186, (byte)66, byte.MaxValue, (byte)150),
				new Color32((byte)155, (byte)5, (byte)193, byte.MaxValue)
			});
		}
	}
	public class shopplugin
	{
		public static IEnumerator shopCoroutinePassive()
		{
			_ = Singleton<GameMaster>.Instance.CurrentGameRun;
			if (((UiBase)UiManager.GetPanel<ShopPanel>()).IsVisible)
			{
				yield break;
			}
			GameMaster instance = Singleton<GameMaster>.Instance;
			if (instance != null)
			{
				instance.CurrentGameRun.LoseMoney(10);
			}
			((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(adventureCoroutine());
			((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(battleCoroutine());
			StationType stationType = Singleton<GameMaster>.Instance.CurrentGameRun.CurrentMap.StartNode.StationType;
			Singleton<GameMaster>.Instance.CurrentGameRun.CurrentMap.StartNode.StationType = (StationType)5;
			ShopStation station = (ShopStation)Singleton<GameMaster>.Instance.CurrentGameRun.CurrentStage.CreateStation(Singleton<GameMaster>.Instance.CurrentGameRun.CurrentMap.StartNode);
			station.CanUseCardService = false;
			Singleton<GameMaster>.Instance.CurrentGameRun.CurrentMap.StartNode.StationType = stationType;
			List<ShopItem<Card>> list = new List<ShopItem<Card>>();
			List<Card> mimapassivelist = toolbox.RollCardsCustom(Singleton<GameMaster>.Instance.CurrentGameRun.BattleCardRng, new CardWeightTable(RarityWeightTable.ShopCard, OwnerWeightTable.AllOnes, CardTypeWeightTable.CanBeLoot, false), 8, null, colorLimit: true, applyFactors: false, battleRolling: false, ensureCount: false, (Card card) => card is mimaextensions.mimacard mimacard2 && mimacard2 is mimaextensions.mimacard.passivecard).ToList();
			List<Card> mimamonsterlist = toolbox.RollCardsCustom(Singleton<GameMaster>.Instance.CurrentGameRun.BattleCardRng, new CardWeightTable(RarityWeightTable.ShopCard, OwnerWeightTable.AllOnes, CardTypeWeightTable.CanBeLoot, false), 2, null, colorLimit: true, applyFactors: false, battleRolling: false, ensureCount: false, (Card card) => card is mimaextensions.mimacard mimacard && mimacard is mimaextensions.mimacard.monstercard).ToList();
			if (mimapassivelist.Count > 0)
			{
				foreach (Card card2 in mimapassivelist)
				{
					Random random = new Random();
					int posorneg2 = random.Next(0, 3);
					int cardcost2 = 0;
					Rarity rarity = card2.Config.Rarity;
					Rarity val = rarity;
					switch ((int)val)
					{
					case 0:
						cardcost2 = 25;
						if (posorneg2 == 2)
						{
							cardcost2 += random.Next(0, 6);
						}
						if (posorneg2 == 0)
						{
							cardcost2 -= random.Next(0, 6);
						}
						break;
					case 1:
						cardcost2 = 50;
						if (posorneg2 == 2)
						{
							cardcost2 += random.Next(0, 11);
						}
						if (posorneg2 == 0)
						{
							cardcost2 -= random.Next(0, 11);
						}
						break;
					case 2:
						cardcost2 = 100;
						if (posorneg2 == 2)
						{
							cardcost2 += random.Next(0, 21);
						}
						if (posorneg2 == 0)
						{
							cardcost2 -= random.Next(0, 21);
						}
						break;
					}
					int discount3 = random.Next(0, 100);
					bool discountpls2 = false;
					if (discount3 > 89)
					{
						discountpls2 = true;
						cardcost2 /= 2;
					}
					list.Add(new ShopItem<Card>(Singleton<GameMaster>.Instance.CurrentGameRun, card2, cardcost2, false, discountpls2));
				}
				foreach (Card card3 in mimamonsterlist)
				{
					Random random2 = new Random();
					int posorneg = random2.Next(0, 3);
					int cardcost = 0;
					Rarity rarity2 = card3.Config.Rarity;
					Rarity val2 = rarity2;
					switch ((int)val2)
					{
					case 0:
						cardcost = 50;
						if (posorneg == 2)
						{
							cardcost += random2.Next(0, 11);
						}
						if (posorneg == 0)
						{
							cardcost -= random2.Next(0, 11);
						}
						break;
					case 1:
						cardcost = 100;
						if (posorneg == 2)
						{
							cardcost += random2.Next(0, 21);
						}
						if (posorneg == 0)
						{
							cardcost -= random2.Next(0, 21);
						}
						break;
					case 2:
						cardcost = 200;
						if (posorneg == 2)
						{
							cardcost += random2.Next(0, 41);
						}
						if (posorneg == 0)
						{
							cardcost -= random2.Next(0, 41);
						}
						break;
					}
					int discount2 = random2.Next(0, 100);
					bool discountpls = false;
					if (discount2 > 89)
					{
						discountpls = true;
						cardcost /= 2;
					}
					list.Add(new ShopItem<Card>(Singleton<GameMaster>.Instance.CurrentGameRun, card3, cardcost, false, discountpls));
				}
			}
			station.DiscountCardNo = 0;
			station.ShopCards = list;
			List<ShopItem<Exhibit>> list2 = new List<ShopItem<Exhibit>>();
			for (int i = 0; i < 3; i++)
			{
				Exhibit shopExhibit = Singleton<GameMaster>.Instance.CurrentGameRun.CurrentStage.GetSentinelExhibit();
				list2.Add(new ShopItem<Exhibit>(Singleton<GameMaster>.Instance.CurrentGameRun, shopExhibit, station.GetPrice(shopExhibit), true, false));
			}
			station.ShopExhibits = list2;
			((UiPanel<ShopStation>)(object)UiManager.GetPanel<ShopPanel>()).Show(station);
			((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(rewardCoroutine());
		}

		public static IEnumerator shopCoroutineBlitz()
		{
			_ = Singleton<GameMaster>.Instance.CurrentGameRun;
			if (((UiBase)UiManager.GetPanel<ShopPanel>()).IsVisible)
			{
				yield break;
			}
			GameMaster instance = Singleton<GameMaster>.Instance;
			if (instance != null)
			{
				instance.CurrentGameRun.LoseMoney(10);
			}
			((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(adventureCoroutine());
			((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(battleCoroutine());
			StationType stationType = Singleton<GameMaster>.Instance.CurrentGameRun.CurrentMap.StartNode.StationType;
			Singleton<GameMaster>.Instance.CurrentGameRun.CurrentMap.StartNode.StationType = (StationType)5;
			ShopStation station = (ShopStation)Singleton<GameMaster>.Instance.CurrentGameRun.CurrentStage.CreateStation(Singleton<GameMaster>.Instance.CurrentGameRun.CurrentMap.StartNode);
			station.CanUseCardService = false;
			Singleton<GameMaster>.Instance.CurrentGameRun.CurrentMap.StartNode.StationType = stationType;
			List<ShopItem<Card>> list = new List<ShopItem<Card>>();
			List<Card> mimablitzlist = toolbox.RepeatableAllCards(Singleton<GameMaster>.Instance.CurrentGameRun.BattleCardRng, new CardWeightTable(RarityWeightTable.BattleCard, OwnerWeightTable.AllOnes, CardTypeWeightTable.CanBeLoot, false), 8, null, colorLimit: true, applyFactors: false, battleRolling: false, ensureCount: false, (Card card) => card is mimaextensions.mimacard mimacard2 && mimacard2 is mimaextensions.mimacard.blitzcard && !(mimacard2 is mimaextensions.mimacard.blitzcard.bmcard)).ToList();
			List<Card> mimabmlist = toolbox.RepeatableAllCards(Singleton<GameMaster>.Instance.CurrentGameRun.BattleCardRng, new CardWeightTable(RarityWeightTable.BattleCard, OwnerWeightTable.AllOnes, CardTypeWeightTable.CanBeLoot, false), 2, null, colorLimit: true, applyFactors: false, battleRolling: false, ensureCount: false, (Card card) => card is mimaextensions.mimacard mimacard && mimacard is mimaextensions.mimacard.blitzcard.bmcard).ToList();
			if (mimablitzlist.Count > 0)
			{
				foreach (Card card2 in mimablitzlist)
				{
					Random random = new Random();
					int posorneg2 = random.Next(0, 3);
					int cardcost2 = 0;
					Rarity rarity = card2.Config.Rarity;
					Rarity val = rarity;
					switch ((int)val)
					{
					case 0:
						cardcost2 = 50;
						if (posorneg2 == 2)
						{
							cardcost2 += random.Next(0, 11);
						}
						if (posorneg2 == 0)
						{
							cardcost2 -= random.Next(0, 11);
						}
						break;
					case 1:
						cardcost2 = 100;
						if (posorneg2 == 2)
						{
							cardcost2 += random.Next(0, 21);
						}
						if (posorneg2 == 0)
						{
							cardcost2 -= random.Next(0, 21);
						}
						break;
					case 2:
						cardcost2 = 200;
						if (posorneg2 == 2)
						{
							cardcost2 += random.Next(0, 41);
						}
						if (posorneg2 == 0)
						{
							cardcost2 -= random.Next(0, 41);
						}
						break;
					}
					int discount3 = random.Next(0, 100);
					bool discountpls2 = false;
					if (discount3 > 89)
					{
						discountpls2 = true;
						cardcost2 /= 2;
					}
					list.Add(new ShopItem<Card>(Singleton<GameMaster>.Instance.CurrentGameRun, card2, cardcost2, false, discountpls2));
				}
				foreach (Card card3 in mimabmlist)
				{
					Random random2 = new Random();
					int posorneg = random2.Next(0, 3);
					int cardcost = 0;
					Rarity rarity2 = card3.Config.Rarity;
					Rarity val2 = rarity2;
					switch ((int)val2)
					{
					case 0:
						cardcost = 100;
						if (posorneg == 2)
						{
							cardcost += random2.Next(0, 21);
						}
						if (posorneg == 0)
						{
							cardcost -= random2.Next(0, 21);
						}
						break;
					case 1:
						cardcost = 200;
						if (posorneg == 2)
						{
							cardcost += random2.Next(0, 41);
						}
						if (posorneg == 0)
						{
							cardcost -= random2.Next(0, 41);
						}
						break;
					case 2:
						cardcost = 400;
						if (posorneg == 2)
						{
							cardcost += random2.Next(0, 81);
						}
						if (posorneg == 0)
						{
							cardcost -= random2.Next(0, 81);
						}
						break;
					}
					int discount2 = random2.Next(0, 100);
					bool discountpls = false;
					if (discount2 > 89)
					{
						discountpls = true;
						cardcost /= 2;
					}
					list.Add(new ShopItem<Card>(Singleton<GameMaster>.Instance.CurrentGameRun, card3, cardcost, false, discountpls));
				}
			}
			station.DiscountCardNo = 0;
			station.ShopCards = list;
			List<ShopItem<Exhibit>> list2 = new List<ShopItem<Exhibit>>();
			for (int i = 0; i < 3; i++)
			{
				Exhibit shopExhibit = Singleton<GameMaster>.Instance.CurrentGameRun.CurrentStage.GetSentinelExhibit();
				list2.Add(new ShopItem<Exhibit>(Singleton<GameMaster>.Instance.CurrentGameRun, shopExhibit, station.GetPrice(shopExhibit), true, false));
			}
			station.ShopExhibits = list2;
			((UiPanel<ShopStation>)(object)UiManager.GetPanel<ShopPanel>()).Show(station);
			((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(rewardCoroutine());
		}

		public static IEnumerator adventureCoroutine()
		{
			if (UiManager.GetPanel<VnPanel>().root.activeSelf)
			{
				bool nextButton = ((Behaviour)UiManager.GetPanel<VnPanel>().nextButton).isActiveAndEnabled;
				UiManager.Hide<BackgroundPanel>(true);
				UiManager.GetPanel<VnPanel>().enemyTitleRoot.SetActive(false);
				UiManager.GetPanel<VnPanel>().adventureTitle.SetActive(false);
				((Component)UiManager.GetPanel<VnPanel>().adventureFrame).gameObject.SetActive(false);
				UiManager.GetPanel<VnPanel>().optionsRoot.SetActive(false);
				((Component)UiManager.GetPanel<VnPanel>().tempArtText).gameObject.SetActive(false);
				UiManager.GetPanel<VnPanel>().root.SetActive(false);
				yield return (object)new WaitUntil((Func<bool>)(() => ((Component)UiManager.GetPanel<VnPanel>().nextButton).gameObject.activeSelf));
				if (!nextButton)
				{
					UiManager.GetPanel<VnPanel>().SetNextButton(false, (int?)0, (Action)null);
				}
				((UiPanel<string>)(object)UiManager.GetPanel<BackgroundPanel>()).Show("Adventure");
				UiManager.GetPanel<VnPanel>().enemyTitleRoot.SetActive(true);
				UiManager.GetPanel<VnPanel>().adventureTitle.SetActive(true);
				((Component)UiManager.GetPanel<VnPanel>().adventureFrame).gameObject.SetActive(true);
				UiManager.GetPanel<VnPanel>().optionsRoot.SetActive(true);
				((Component)UiManager.GetPanel<VnPanel>().tempArtText).gameObject.SetActive(true);
				UiManager.GetPanel<VnPanel>().root.SetActive(true);
			}
		}

		public static IEnumerator battleCoroutine()
		{
			if (((UiBase)UiManager.GetPanel<PlayBoard>()).IsVisible)
			{
				((UiPanelBase)UiManager.GetPanel<PlayBoard>()).Hide();
				yield return (object)new WaitUntil((Func<bool>)(() => ((Component)UiManager.GetPanel<VnPanel>().nextButton).gameObject.activeSelf));
				UiManager.GetPanel<VnPanel>().SetNextButton(false, (int?)0, (Action)null);
				((UiPanel)UiManager.GetPanel<PlayBoard>()).Show();
			}
		}

		public static IEnumerator rewardCoroutine()
		{
			if (((UiBase)UiManager.GetPanel<RewardPanel>()).IsVisible)
			{
				Singleton<GameMaster>.Instance.CurrentGameRun.CurrentStation.Status = (StationStatus)3;
				((Component)UiManager.GetPanel<RewardPanel>()).gameObject.SetActive(false);
				yield return (object)new WaitUntil((Func<bool>)(() => ((Component)UiManager.GetPanel<VnPanel>().nextButton).gameObject.activeSelf));
				Singleton<GameMaster>.Instance.CurrentGameRun.CurrentStation.Status = (StationStatus)4;
				((Component)UiManager.GetPanel<RewardPanel>()).gameObject.SetActive(true);
				Station station = Singleton<GameMaster>.Instance.CurrentGameRun.CurrentStation;
				yield return (object)new WaitUntil((Func<bool>)(() => station != Singleton<GameMaster>.Instance.CurrentGameRun.CurrentStation));
				((Component)UiManager.GetPanel<RewardPanel>()).gameObject.SetActive(false);
			}
		}
	}
	public abstract class toolbox
	{
		public static Card[] RollCardsCustomIgnore(RandomGen rng, CardWeightTable weightTable, int count, ManaGroup? manaLimit = null, bool colorLimit = false, bool applyFactors = false, bool battleRolling = false, bool ensureCount = false, Predicate<Card> filter = null)
		{
			GameMaster instance = Singleton<GameMaster>.Instance;
			GameRunController val = ((instance != null) ? instance.CurrentGameRun : null);
			if (val == null)
			{
				throw new InvalidOperationException("Rolling cards when run is not started.");
			}
			UniqueRandomPool<Type> val2 = val.CreateValidCardsPool(weightTable, manaLimit, colorLimit, applyFactors, battleRolling, (Predicate<CardConfig>)null);
			UniqueRandomPool<Card> val3 = new UniqueRandomPool<Card>(false);
			foreach (RandomPoolEntry<Type> item in val2)
			{
				Card val4 = Library.CreateCard(item.Elem);
				if (filter(val4))
				{
					((GameEntity)val4).GameRun = val;
					val3.Add(val4, item.Weight);
				}
			}
			return val3.SampleMany(rng, count, ensureCount);
		}

		public static Card[] RollCardsCustom(RandomGen rng, CardWeightTable weightTable, int count, ManaGroup? manaLimit = null, bool colorLimit = false, bool applyFactors = false, bool battleRolling = false, bool ensureCount = false, Predicate<Card> filter = null)
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			GameMaster instance = Singleton<GameMaster>.Instance;
			GameRunController val = ((instance != null) ? instance.CurrentGameRun : null);
			if (val == null)
			{
				throw new InvalidOperationException("Rolling cards when run is not started.");
			}
			UniqueRandomPool<Type> val2 = val.CreateValidCardsPool(weightTable, manaLimit, colorLimit, applyFactors, battleRolling, (Predicate<CardConfig>)null);
			UniqueRandomPool<Card> val3 = new UniqueRandomPool<Card>(false);
			foreach (RandomPoolEntry<Type> item in val2)
			{
				Card val4 = Library.CreateCard(item.Elem);
				if (filter(val4))
				{
					ManaGroup baseMana = val.BaseMana;
					if (((ManaGroup)(ref baseMana)).CanAfford(val4.Cost))
					{
						((GameEntity)val4).GameRun = val;
						val3.Add(val4, item.Weight);
					}
				}
			}
			return val3.SampleMany(rng, count, ensureCount);
		}

		public static Card[] RepeatableAllCards(RandomGen rng, CardWeightTable weightTable, int count, ManaGroup? manaLimit = null, bool colorLimit = false, bool applyFactors = false, bool battleRolling = false, bool ensureCount = false, Predicate<Card> filter = null)
		{
			GameMaster instance = Singleton<GameMaster>.Instance;
			GameRunController val = ((instance != null) ? instance.CurrentGameRun : null);
			if (val == null)
			{
				throw new InvalidOperationException("Rolling cards when run is not started.");
			}
			UniqueRandomPool<Type> val2 = CreateAllCardsPool(weightTable, manaLimit, colorLimit, applyFactors, battleRolling);
			RepeatableRandomPool<Card> val3 = new RepeatableRandomPool<Card>();
			foreach (RandomPoolEntry<Type> item in val2)
			{
				Card val4 = Library.CreateCard(item.Elem);
				if (filter(val4))
				{
					((GameEntity)val4).GameRun = val;
					val3.Add(val4, item.Weight);
				}
			}
			return val3.SampleMany(rng, count, ensureCount);
		}

		public static Card[] UniqueAllCards(RandomGen rng, CardWeightTable weightTable, int count, ManaGroup? manaLimit = null, bool colorLimit = false, bool applyFactors = false, bool battleRolling = false, bool ensureCount = false, Predicate<Card> filter = null)
		{
			GameMaster instance = Singleton<GameMaster>.Instance;
			GameRunController val = ((instance != null) ? instance.CurrentGameRun : null);
			if (val == null)
			{
				throw new InvalidOperationException("Rolling cards when run is not started.");
			}
			UniqueRandomPool<Type> val2 = CreateAllCardsPool(weightTable, manaLimit, colorLimit, applyFactors, battleRolling);
			UniqueRandomPool<Card> val3 = new UniqueRandomPool<Card>(false);
			foreach (RandomPoolEntry<Type> item in val2)
			{
				Card val4 = Library.CreateCard(item.Elem);
				if (filter(val4))
				{
					((GameEntity)val4).GameRun = val;
					val3.Add(val4, item.Weight);
				}
			}
			return val3.SampleMany(rng, count, ensureCount);
		}

		public static UniqueRandomPool<Type> CreateAllCardsPool(CardWeightTable weightTable, ManaGroup? manaLimit, bool colorLimit, bool applyFactors, bool battleRolling, [MaybeNull] Predicate<CardConfig> filter = null)
		{
			GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
			HashSet<string> hashSet = new HashSet<string>(from e in currentGameRun.Player.Exhibits
				where e.OwnerId != null
				select e.OwnerId);
			UniqueRandomPool<Type> val = new UniqueRandomPool<Type>(false);
			foreach (var (type, val2) in Library.EnumerateRollableCardTypes(10))
			{
				if (filter == null || filter(val2))
				{
					float num = weightTable.WeightFor(val2, ((GameEntity)currentGameRun.Player).Id, (ISet<string>)hashSet);
					if (num > 0f)
					{
						float num2 = currentGameRun.BaseCardWeight(val2, applyFactors);
						val.Add(type, num * num2);
					}
				}
			}
			return val;
		}
	}
	public sealed class ultadef : UltimateSkillTemplate
	{
		[EntityLogic(typeof(ultadef))]
		public sealed class ulta : UltimateSkill
		{
			public int hplosing => ((UltimateSkill)this).Value1;

			public ulta()
			{
				((UltimateSkill)this).TargetType = (TargetType)3;
				((UltimateSkill)this).GunName = "Butterfly1";
			}

			protected override IEnumerable<BattleAction> Actions(UnitSelector selector)
			{
				yield return (BattleAction)(object)PerformAction.Spell((Unit)(object)((UltimateSkill)this).Battle.Player, "ulta");
				yield return (BattleAction)new DamageAction((Unit)(object)((UltimateSkill)this).Owner, (Unit)(object)((UltimateSkill)this).Owner, DamageInfo.HpLose((float)hplosing, true), "Instant", (GunType)0);
				int atktimeleft = ((UltimateSkill)this).Value2;
				while (atktimeleft > 0 && !((UltimateSkill)this).Battle.BattleShouldEnd)
				{
					atktimeleft--;
					yield return (BattleAction)new DamageAction((Unit)(object)((UltimateSkill)this).Owner, (Unit)(object)selector.GetEnemy(((UltimateSkill)this).Battle), ((UltimateSkill)this).Damage, ((UltimateSkill)this).GunName, (GunType)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("ulta");
		}

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.ultbatchloc.AddEntity((EntityDefinition)(object)this);
		}

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

		public override UltimateSkillConfig MakeConfig()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			return new UltimateSkillConfig("", 10, 100, 100, 2, (UsRepeatableType)0, 6, 33, 6, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>());
		}
	}
	public sealed class ultbdef : UltimateSkillTemplate
	{
		[EntityLogic(typeof(ultbdef))]
		public sealed class ultb : UltimateSkill
		{
			public int hplosing => ((UltimateSkill)this).Value1;

			public ultb()
			{
				((UltimateSkill)this).TargetType = (TargetType)4;
			}

			protected override IEnumerable<BattleAction> Actions(UnitSelector selector)
			{
				yield return (BattleAction)(object)PerformAction.Spell((Unit)(object)((UltimateSkill)this).Battle.Player, "ultb");
				yield return (BattleAction)new DamageAction((Unit)(object)((UltimateSkill)this).Owner, (Unit)(object)((UltimateSkill)this).Owner, DamageInfo.HpLose((float)hplosing, true), "Instant", (GunType)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("ultb");
		}

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.ultbatchloc.AddEntity((EntityDefinition)(object)this);
		}

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

		public override UltimateSkillConfig MakeConfig()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			return new UltimateSkillConfig("", 10, 120, 120, 3, (UsRepeatableType)0, 0, 666, 0, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>());
		}
	}
	internal class WatermarkWrapper
	{
	}
}
namespace lvalonmima.SE
{
	public sealed class evilspiritdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(evilspiritdef))]
		public sealed class evilspirit : mimaextensions.mimase
		{
			private bool thisround = false;

			public evilspirit()
			{
				base.truecounter = 0;
			}

			protected override void OnAdded(Unit unit)
			{
				//IL_0261: Unknown result type (might be due to invalid IL or missing references)
				//IL_026b: Expected O, but got Unknown
				//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_02eb: Expected O, but got Unknown
				((StatusEffect)this).Count = 1;
				if (unit.Hp > 66)
				{
					((GameEntity)this).GameRun.SetHpAndMaxHp(66, 66, false);
				}
				else
				{
					((GameEntity)this).GameRun.SetHpAndMaxHp(unit.Hp, 66, false);
				}
				((StatusEffect)this).ReactOwnerEvent<GameEventArgs>(((StatusEffect)this).Battle.RoundEnding, (EventSequencedReactor<GameEventArgs>)OnRoundEnding);
				((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(((Unit)((StatusEffect)this).Battle.Player).StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnStatusEffectAdded);
				((StatusEffect)this).HandleOwnerEvent<DamageDealingEventArgs>(((StatusEffect)this).Owner.DamageDealing, (GameEventHandler<DamageDealingEventArgs>)OnDamageDealing);
				((StatusEffect)this).HandleOwnerEvent<DamageEventArgs>(((Unit)((StatusEffect)this).Battle.Player).DamageDealt, (GameEventHandler<DamageEventArgs>)OnPlayerDamageDealt);
				((StatusEffect)this).HandleOwnerEvent<DieEventArgs>(((StatusEffect)this).Owner.Dying, (GameEventHandler<DieEventArgs>)OnDying);
				((StatusEffect)this).HandleOwnerEvent<UnitEventArgs>(((StatusEffect)this).Owner.TurnStarting, (GameEventHandler<UnitEventArgs>)OnOwnerTurnStarting);
				((StatusEffect)this).ReactOwnerEvent<GameEventArgs>(((StatusEffect)this).Battle.BattleEnding, (EventSequencedReactor<GameEventArgs>)OnBattleEnding);
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(unit, "JunkoNightmare", 0f, "JunkoNightmare", 0f, (EffectBehavior)0, 0f)));
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(unit, "JunkoNightmare", 1f, "", 0f, (EffectBehavior)0, 0f)));
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(unit, "JunkoNightmare", 2f, "", 0f, (EffectBehavior)0, 0f)));
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(unit, "JinziMirror", 3f, "", 1f, (EffectBehavior)1, 0f)));
				((StatusEffect)this).ReactOwnerEvent<BlockShieldEventArgs>(((Unit)((StatusEffect)this).Battle.Player).BlockShieldGained, (EventSequencedReactor<BlockShieldEventArgs>)OnBlockShieldGained);
				if (((StatusEffect)this).Owner.Block > 0)
				{
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)new ApplyStatusEffectAction<magicalburstdef.magicalburst>(((StatusEffect)this).Owner, (int?)((StatusEffect)this).Owner.Block, (int?)null, (int?)null, (int?)null, 0f, true)));
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)new LoseBlockShieldAction(((StatusEffect)this).Owner, ((StatusEffect)this).Owner.Block, 0, false)));
				}
				if (((StatusEffect)this).Owner.Shield > 0)
				{
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)new ApplyStatusEffectAction<magicalburstdef.magicalburst>(((StatusEffect)this).Owner, (int?)((StatusEffect)this).Owner.Shield, (int?)null, (int?)null, (int?)null, 0f, true)));
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)new LoseBlockShieldAction(((StatusEffect)this).Owner, 0, ((StatusEffect)this).Owner.Shield, false)));
				}
			}

			private void OnDying(DieEventArgs args)
			{
				//IL_0125: Unknown result type (might be due to invalid IL or missing references)
				//IL_0130: Expected O, but got Unknown
				if (((GameEventArgs)args).ActionSource != this)
				{
					((StatusEffect)this).NotifyActivating();
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(((StatusEffect)this).Owner, "JinziMirror", 3f, "", 1f, (EffectBehavior)1, 0f)));
					if (((GameEntity)((StatusEffect)this).Battle.Player).BaseName == ((GameEntity)((StatusEffect)this).Owner).BaseName)
					{
						((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(((StatusEffect)this).Owner, "JunkoNightmare", 0f, "JunkoNightmare", 0f, (EffectBehavior)0, 0f)));
						((GameEntity)this).GameRun.SetHpAndMaxHp(((StatusEffect)this).Owner.MaxHp, ((StatusEffect)this).Owner.MaxHp, false);
						((GameEventArgs)args).CancelBy((GameEntity)(object)this);
					}
					else
					{
						((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(((StatusEffect)this).Owner, "JunkoNightmare", 0f, "JunkoNightmare", 0f, (EffectBehavior)0, 0f)));
						((GameEntity)this).GameRun.SetEnemyHpAndMaxHp(((StatusEffect)this).Owner.MaxHp, ((StatusEffect)this).Owner.MaxHp, (EnemyUnit)((StatusEffect)this).Owner, false);
						((GameEventArgs)args).CancelBy((GameEntity)(object)this);
					}
					if (((GameEntity)this).GameRun.Battle != null)
					{
						((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)new ApplyStatusEffectAction<karmanationdef.karmanation>(((StatusEffect)this).Owner, (int?)1, (int?)null, (int?)null, (int?)null, 0f, true)));
						((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)new ApplyStatusEffectAction<grudgetoldef.grudgetol>(((StatusEffect)this).Owner, (int?)1, (int?)null, (int?)null, (int?)null, 0f, true)));
					}
					if (((GameEntity)this).GameRun.Battle != null && !thisround)
					{
						int level = ((StatusEffect)this).Level;
						((StatusEffect)this).Level = level + 1;
						thisround = true;
						((StatusEffect)this).Count = 0;
					}
				}
			}

			private IEnumerable<BattleAction> OnRoundEnding(GameEventArgs args)
			{
				thisround = false;
				((StatusEffect)this).Count = 1;
				int num = ((StatusEffect)this).Level - 1;
				((StatusEffect)this).Level = num;
				if (((StatusEffect)this).Level == 0)
				{
					((StatusEffect)this).NotifyActivating();
					yield return (BattleAction)new ForceKillAction(((StatusEffect)this).Owner, ((StatusEffect)this).Owner);
					int level = ((StatusEffect)this).Level;
					((StatusEffect)this).Level = level + 1;
				}
			}

			private IEnumerable<BattleAction> OnBattleEnding(GameEventArgs args)
			{
				if (((StatusEffect)this).Owner.IsAlive)
				{
					((StatusEffect)this).NotifyActivating();
					yield return (BattleAction)new HealAction(((StatusEffect)this).Owner, ((StatusEffect)this).Owner, ((StatusEffect)this).Owner.MaxHp, (HealType)0, 0.2f);
				}
			}

			private void OnOwnerTurnStarting(UnitEventArgs args)
			{
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(((StatusEffect)this).Owner, "JinziMirror", 3f, "", 1f, (EffectBehavior)1, 0f)));
			}

			private IEnumerable<BattleAction> OnStatusEffectAdded(StatusEffectApplyEventArgs args)
			{
				yield break;
			}

			private void OnDamageDealing(DamageDealingEventArgs args)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Invalid comparison between Unknown and I4
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				DamageInfo damageInfo = args.DamageInfo;
				if ((int)((DamageInfo)(ref damageInfo)).DamageType == 2)
				{
					((DamageInfo)(ref damageInfo)).Damage = ((DamageInfo)(ref damageInfo)).Amount * 0.25f;
					args.DamageInfo = damageInfo;
					((GameEventArgs)args).AddModifier((GameEntity)(object)this);
				}
			}

			private IEnumerable<BattleAction> OnBlockShieldGained(BlockShieldEventArgs args)
			{
				if (args.HasBlock)
				{
					yield return (BattleAction)(object)new ApplyStatusEffectAction<magicalburstdef.magicalburst>(((StatusEffect)this).Owner, (int?)(int)args.Block, (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)new LoseBlockShieldAction(((StatusEffect)this).Owner, ((StatusEffect)this).Owner.Block, 0, false);
					((GameEventArgs)args).AddModifier((GameEntity)(object)this);
				}
				if (args.HasShield)
				{
					yield return (BattleAction)(object)new ApplyStatusEffectAction<magicalburstdef.magicalburst>(((StatusEffect)this).Owner, (int?)(int)args.Shield, (int?)null, (int?)null, (int?)null, 0f, true);
					yield return (BattleAction)new LoseBlockShieldAction(((StatusEffect)this).Owner, 0, ((StatusEffect)this).Owner.Shield, false);
					((GameEventArgs)args).AddModifier((GameEntity)(object)this);
				}
				((GameEventArgs)args).CancelBy((GameEntity)(object)this);
			}

			private void OnPlayerDamageDealt(DamageEventArgs args)
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Invalid comparison between Unknown and I4
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				if (!((StatusEffect)this).Battle.BattleShouldEnd && (int)((GameEventArgs)args).Cause == 1 && ((GameEventArgs)args).ActionSource == this)
				{
					int num = base.truecounter;
					DamageInfo damageInfo = args.DamageInfo;
					base.truecounter = num + (int)((DamageInfo)(ref damageInfo)).Damage;
				}
			}
		}

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

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(CardConfig)), "", 20, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, true, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string> { "karmanation", "grudgetol" }, "Default", "Default", "Default");
		}
	}
	public sealed class exfireonskilldef : StatusEffectTemplate
	{
		[EntityLogic(typeof(exfireonskilldef))]
		public sealed class exfireonskill : mimaextensions.mimaexpartner
		{
			protected override void OnAdded(Unit unit)
			{
				((ExtraTurnPartner)this).ThisTurnActivating = false;
				((StatusEffect)this).HandleOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnStarting, (GameEventHandler<UnitEventArgs>)delegate
				{
					if (((Unit)((StatusEffect)this).Battle.Player).IsExtraTurn && !((StatusEffect)this).Battle.Player.IsSuperExtraTurn && ((Unit)((StatusEffect)this).Battle.Player).GetStatusEffectExtend<ExtraTurnPartner>() == this)
					{
						((ExtraTurnPartner)this).ThisTurnActivating = true;
					}
				});
				((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
				((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnEnding, (EventSequencedReactor<UnitEventArgs>)(object)new EventSequencedReactor<GameEventArgs>(OnPlayerTurnEnding));
			}

			private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
			{
				if ((int)args.Card.CardType == 3 && ((ExtraTurnPartner)this).ThisTurnActivating)
				{
					((StatusEffect)this).NotifyActivating();
					yield return (BattleAction)(object)new ApplyStatusEffectAction<extmpfiredef.extmpfire>(((StatusEffect)this).Owner, (int?)((StatusEffect)this).Level, (int?)null, (int?)null, (int?)null, 0.2f, true);
				}
			}

			private IEnumerable<BattleAction> OnPlayerTurnEnding(GameEventArgs args)
			{
				if (((ExtraTurnPartner)this).ThisTurnActivating)
				{
					((StatusEffect)this).NotifyActivating();
					yield return (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("exfireonskill");
		}

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(CardConfig)), "", 1, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string> { "extmpfire" }, "Default", "Default", "Default");
		}
	}
	public sealed class extmpfiredef : StatusEffectTemplate
	{
		[EntityLogic(typeof(extmpfiredef))]
		public sealed class extmpfire : mimaextensions.mimase
		{
			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).HandleOwnerEvent<DamageDealingEventArgs>(unit.DamageDealing, (GameEventHandler<DamageDealingEventArgs>)OnDamageDealing);
				((StatusEffect)this).ReactOwnerEvent<GameEventArgs>(((StatusEffect)this).Battle.RoundEnded, (EventSequencedReactor<GameEventArgs>)OnRoundEnded);
			}

			private void OnDamageDealing(DamageDealingEventArgs args)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Invalid comparison between Unknown and I4
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				DamageInfo damageInfo = args.DamageInfo;
				if ((int)((DamageInfo)(ref damageInfo)).DamageType == 2)
				{
					damageInfo = args.DamageInfo;
					args.DamageInfo = ((DamageInfo)(ref damageInfo)).IncreaseBy(((StatusEffect)this).Level);
					((GameEventArgs)args).AddModifier((GameEntity)(object)this);
				}
			}

			private IEnumerable<BattleAction> OnRoundEnded(GameEventArgs args)
			{
				((StatusEffect)this).NotifyActivating();
				yield return (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("extmpfire");
		}

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(CardConfig)), "", 3, (StatusEffectType)0, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class grudgetoldef : StatusEffectTemplate
	{
		[EntityLogic(typeof(grudgetoldef))]
		public sealed class grudgetol : mimaextensions.mimase
		{
			private bool thisround = false;

			public int loselife => (((GameEntity)this).GameRun.Battle == null) ? 2 : ((((StatusEffect)this).Level >= 27) ? Convert.ToInt32(Math.Pow(2.0, 27.0)) : Convert.ToInt32(Math.Pow(2.0, ((StatusEffect)this).Level)));

			private float loselifeinternal => (((GameEntity)this).GameRun.Battle == null) ? 50 : ((((StatusEffect)this).Level >= 27) ? (100 - 100 / Convert.ToInt32(Math.Pow(2.0, 27.0))) : (100 - 100 / Convert.ToInt32(Math.Pow(2.0, ((StatusEffect)this).Level))));

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).HandleOwnerEvent<DamageEventArgs>(((StatusEffect)this).Owner.DamageReceiving, (GameEventHandler<DamageEventArgs>)OnDamageReceiving);
				((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(((StatusEffect)this).Owner.StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnStatusEffectAdded);
				((StatusEffect)this).ReactOwnerEvent<GameEventArgs>(((StatusEffect)this).Battle.RoundEnding, (EventSequencedReactor<GameEventArgs>)OnRoundEnding);
				((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((StatusEffect)this).Owner.TurnStarting, (EventSequencedReactor<UnitEventArgs>)OnTurnStarting);
			}

			private void OnDamageReceiving(DamageEventArgs args)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				DamageInfo damageInfo = args.DamageInfo;
				((DamageInfo)(ref damageInfo)).Damage = ((DamageInfo)(ref damageInfo)).Amount * ((100f - loselifeinternal) / 100f);
				args.DamageInfo = damageInfo;
				((GameEventArgs)args).AddModifier((GameEntity)(object)this);
			}

			private IEnumerable<BattleAction> OnStatusEffectAdded(StatusEffectApplyEventArgs args)
			{
				if (((GameEntity)args.Effect).Id == "karmanation")
				{
					thisround = true;
				}
				BepinexPlugin.log.LogDebug((object)((GameEntity)args.Effect).Id);
				BepinexPlugin.log.LogDebug((object)"karmanation");
				yield break;
			}

			private IEnumerable<BattleAction> OnTurnStarting(GameEventArgs args)
			{
				thisround = false;
				yield break;
			}

			private IEnumerable<BattleAction> OnRoundEnding(GameEventArgs args)
			{
				if (!thisround)
				{
					int num = ((StatusEffect)this).Level - 1;
					((StatusEffect)this).Level = num;
					if (((StatusEffect)this).Level == 0)
					{
						((StatusEffect)this).NotifyActivating();
						yield return (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("grudgetol");
		}

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(CardConfig)), "", 999, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class karmanationdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(karmanationdef))]
		public sealed class karmanation : mimaextensions.mimase
		{
			public int dmgscale => (((GameEntity)this).GameRun.Battle == null) ? 2 : ((((StatusEffect)this).Level >= 27) ? Convert.ToInt32(Math.Pow(2.0, 27.0)) : Convert.ToInt32(Math.Pow(2.0, ((StatusEffect)this).Level)));

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).HandleOwnerEvent<DamageDealingEventArgs>(((StatusEffect)this).Owner.DamageDealing, (GameEventHandler<DamageDealingEventArgs>)OnDamageDealing);
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(unit, "JunkoNightmare", 0f, "JunkoNightmare", 0f, (EffectBehavior)0, 0f)));
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(unit, "JunkoNightmare", 1f, "", 0f, (EffectBehavior)0, 0f)));
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(unit, "JunkoNightmare", 2f, "", 0f, (EffectBehavior)0, 0f)));
			}

			private void OnDamageDealing(DamageDealingEventArgs args)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Invalid comparison between Unknown and I4
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: 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_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: Invalid comparison between Unknown and I4
				DamageInfo damageInfo = args.DamageInfo;
				if ((int)((DamageInfo)(ref damageInfo)).DamageType == 2)
				{
					damageInfo = args.DamageInfo;
					args.DamageInfo = ((DamageInfo)(ref damageInfo)).MultiplyBy((((StatusEffect)this).Level >= 27) ? Convert.ToInt32(Math.Pow(2.0, 27.0)) : Convert.ToInt32(Math.Pow(2.0, ((StatusEffect)this).Level)));
					((GameEventArgs)args).AddModifier((GameEntity)(object)this);
					if ((int)((GameEventArgs)args).Cause != 20)
					{
						((StatusEffect)this).NotifyActivating();
					}
				}
			}
		}

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

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("sekarmanation.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(CardConfig)), "", 20, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class magicalburstdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(magicalburstdef))]
		public sealed class magicalburst : mimaextensions.mimase
		{
			private bool dealdmgletsgo = false;

			private int fireneeded = 0;

			private int counterlost = 0;

			private int otcounter = 0;

			private float actualdmg = 0f;

			public int burstdmgshow => (((StatusEffect)this).Battle != null) ? Convert.ToInt32(0) : 0;

			public override bool ForceNotShowDownText => true;

			public magicalburst()
			{
				base.truecounter = 0;
			}

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).HandleOwnerEvent<StatusEffectApplyEventArgs>(((StatusEffect)this).Owner.StatusEffectAdding, (GameEventHandler<StatusEffectApplyEventArgs>)OnStatusEffectAdding);
				((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(((StatusEffect)this).Owner.StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnStatusEffectAdded);
				((StatusEffect)this).ReactOwnerEvent<StatusEffectEventArgs>(((StatusEffect)this).Owner.StatusEffectRemoved, (EventSequencedReactor<StatusEffectEventArgs>)OnStatusEffectRemoved);
				((StatusEffect)this).HandleOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsing, (GameEventHandler<CardUsingEventArgs>)OnCardUsing);
				((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
				((StatusEffect)this).ReactOwnerEvent<GameEventArgs>(((StatusEffect)this).Battle.AllEnemyTurnStarting, (EventSequencedReactor<GameEventArgs>)OnAllEnemyTurnStarting1);
				((StatusEffect)this).ReactOwnerEvent<GameEventArgs>(((StatusEffect)this).Battle.AllEnemyTurnStarting, (EventSequencedReactor<GameEventArgs>)OnAllEnemyTurnStarting2);
			}

			private void OnStatusEffectAdding(StatusEffectApplyEventArgs args)
			{
				StatusEffect effect = args.Effect;
				if (effect is TempFirepower)
				{
					fireneeded = effect.Level;
					MeilingAbilitySe val = default(MeilingAbilitySe);
					if (((StatusEffect)this).Owner.TryGetStatusEffect<MeilingAbilitySe>(ref val))
					{
						fireneeded *= 2;
					}
					((StatusEffect)this).NotifyActivating();
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)new ApplyStatusEffectAction<extmpfiredef.extmpfire>(((StatusEffect)this).Owner, (int?)fireneeded, (int?)null, (int?)null, (int?)null, 0f, true)));
					((GameEventArgs)args).CancelBy((GameEntity)(object)this);
				}
			}

			private IEnumerable<BattleAction> OnStatusEffectAdded(StatusEffectApplyEventArgs args)
			{
				StatusEffect effect = args.Effect;
				if (effect is mimaextensions.mimase mimase && mimaextensions.mimase.MBmods.Contains(((GameEntity)mimase).Id))
				{
					((GameEntity)this).NotifyChanged();
					dmgcalc();
				}
				if (((GameEntity)args.Effect).Id == "magicalburst")
				{
					((GameEntity)this).NotifyChanged();
					dmgcalc();
				}
				fastburstdef.fastburst tmp = default(fastburstdef.fastburst);
				mimaextensions.mimase fastburst = default(mimaextensions.mimase);
				int num;
				if (((StatusEffect)this).Owner.TryGetStatusEffect<fastburstdef.fastburst>(ref tmp))
				{
					fastburst = tmp;
					num = ((fastburst != null) ? 1 : 0);
				}
				else
				{
					num = 0;
				}
				if (num != 0)
				{
					dealdmg(((StatusEffect)fastburst).Level * 20);
				}
				yield break;
			}

			private IEnumerable<BattleAction> OnStatusEffectRemoved(StatusEffectEventArgs args)
			{
				StatusEffect effect = args.Effect;
				if (effect is mimaextensions.mimase mimase && mimaextensions.mimase.MBmods.Contains(((GameEntity)mimase).Id))
				{
					((GameEntity)this).NotifyChanged();
					dmgcalc();
				}
				yield break;
			}

			private void OnCardUsing(CardUsingEventArgs args)
			{
			}

			private void dealdmg(int consume100)
			{
				if (consume100 > 0 && base.truecounter > 0)
				{
					((StatusEffect)this).NotifyActivating();
					actualdmg = consume100 * base.truecounter / 100;
					dealdmgletsgo = true;
				}
			}

			private void dmgcalc()
			{
				everlastingmagicdef.everlastingmagic everlastingmagic = default(everlastingmagicdef.everlastingmagic);
				if (((StatusEffect)this).Owner.TryGetStatusEffect<everlastingmagicdef.everlastingmagic>(ref everlastingmagic) && ((StatusEffect)everlastingmagic).Level < 5)
				{
					if (((StatusEffect)everlastingmagic).Level == 1)
					{
						base.truecounter += Convert.ToInt32(Math.Round((double)((StatusEffect)this).Level * 0.5, MidpointRounding.AwayFromZero));
					}
					else
					{
						base.truecounter += ((StatusEffect)this).Level;
					}
				}
				else
				{
					base.truecounter += ((StatusEffect)this).Level;
				}
				if (base.truecounter < otcounter)
				{
					counterlost += otcounter - base.truecounter;
				}
				if (base.truecounter > 999)
				{
					((StatusEffect)this).Count = 999;
				}
				else
				{
					((StatusEffect)this).Count = base.truecounter;
				}
				otcounter = base.truecounter;
				((StatusEffect)this).Level = 0;
			}

			private IEnumerable<BattleAction> OnAllEnemyTurnStarting1(GameEventArgs args)
			{
				accumulationdef.accumulation accumulation = default(accumulationdef.accumulation);
				if (((StatusEffect)this).Owner.TryGetStatusEffect<accumulationdef.accumulation>(ref accumulation))
				{
					accumulationdef.accumulation accumulation2 = accumulation;
					((StatusEffect)accumulation2).Level = ((StatusEffect)accumulation2).Level - 1;
					if (((StatusEffect)accumulation).Level == 0)
					{
						yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)accumulation, true, 0.1f);
					}
				}
				else if (base.truecounter > 0)
				{
					((StatusEffect)this).NotifyActivating();
					dealdmg(100);
				}
			}

			private IEnumerable<BattleAction> OnAllEnemyTurnStarting2(GameEventArgs args)
			{
				if (((StatusEffect)this).Owner == null || ((StatusEffect)this).Battle.BattleShouldEnd)
				{
					yield break;
				}
				if (dealdmgletsgo)
				{
					splitburstdef.splitburst splitburstfirst = default(splitburstdef.splitburst);
					concentratedburstdef.concentratedburst concentratedfirst = default(concentratedburstdef.concentratedburst);
					if (((StatusEffect)this).Owner.TryGetStatusEffect<splitburstdef.splitburst>(ref splitburstfirst) && !((StatusEffect)this).Owner.TryGetStatusEffect<concentratedburstdef.concentratedburst>(ref concentratedfirst))
					{
						for (int i = ((StatusEffect)splitburstfirst).Level; i >= 0; i--)
						{
							if (!((StatusEffect)this).Battle.BattleShouldEnd)
							{
								yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (IEnumerable<Unit>)((StatusEffect)this).Battle.EnemyGroup.Alives, DamageInfo.Attack((float)Convert.ToInt32(actualdmg / (float)(((StatusEffect)splitburstfirst).Level + 1)), true), "JunkoLunatic", (GunType)0);
							}
						}
					}
					concentratedburstdef.concentratedburst concentratedburst = default(concentratedburstdef.concentratedburst);
					splitburstdef.splitburst splitburst2 = default(splitburstdef.splitburst);
					if (((StatusEffect)this).Owner.TryGetStatusEffect<concentratedburstdef.concentratedburst>(ref concentratedburst))
					{
						int enemycount = 0;
						foreach (EnemyUnit allAliveEnemy in ((StatusEffect)this).Battle.AllAliveEnemies)
						{
							_ = allAliveEnemy;
							enemycount++;
						}
						int conmultiplied = enemycount * ((StatusEffect)concentratedburst).Level;
						splitburstdef.splitburst splitburst = default(splitburstdef.splitburst);
						if (((StatusEffect)this).Owner.TryGetStatusEffect<splitburstdef.splitburst>(ref splitburst))
						{
							int consplit = conmultiplied * (1 + ((StatusEffect)splitburst).Level);
							for (int k = consplit; k > 0; k--)
							{
								if (!((StatusEffect)this).Battle.BattleShouldEnd)
								{
									yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)CollectionsExtensions.SampleOrDefault<EnemyUnit>(((StatusEffect)this).Battle.EnemyGroup.Alives, ((StatusEffect)this).Battle.GameRun.BattleRng), DamageInfo.Attack((float)Convert.ToInt32(actualdmg / (float)(((StatusEffect)splitburst).Level + 1)), true), "JunkoLunaticHit", (GunType)0);
								}
							}
						}
						else
						{
							for (int j = conmultiplied; j > 0; j--)
							{
								if (!((StatusEffect)this).Battle.BattleShouldEnd)
								{
									yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)CollectionsExtensions.SampleOrDefault<EnemyUnit>(((StatusEffect)this).Battle.EnemyGroup.Alives, ((StatusEffect)this).Battle.GameRun.BattleRng), DamageInfo.Attack(actualdmg, true), "JunkoLunaticHit", (GunType)0);
								}
							}
						}
					}
					else if (!((StatusEffect)this).Owner.TryGetStatusEffect<splitburstdef.splitburst>(ref splitburst2) && !((StatusEffect)this).Battle.BattleShouldEnd)
					{
						yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (IEnumerable<Unit>)((StatusEffect)this).Battle.EnemyGroup.Alives, DamageInfo.Attack(actualdmg, true), "JunkoLunatic", (GunType)0);
					}
					everlastingmagicdef.everlastingmagic tmp = default(everlastingmagicdef.everlastingmagic);
					if (!((StatusEffect)this).Owner.TryGetStatusEffect<everlastingmagicdef.everlastingmagic>(ref tmp))
					{
						base.truecounter -= (int)actualdmg;
						actualdmg = 0f;
						yield return (BattleAction)(object)new ApplyStatusEffectAction<magicalburst>(((StatusEffect)this).Owner, (int?)0, (int?)null, (int?)null, (int?)null, 0f, false);
					}
				}
				dealdmgletsgo = false;
				dmgcalc();
			}

			private IEnumerable<BattleAction> OnCardUsed(GameEventArgs args)
			{
				if (((StatusEffect)this).Owner == null || ((StatusEffect)this).Battle.BattleShouldEnd)
				{
					yield break;
				}
				if (dealdmgletsgo)
				{
					splitburstdef.splitburst splitburstfirst = default(splitburstdef.splitburst);
					concentratedburstdef.concentratedburst concentratedfirst = default(concentratedburstdef.concentratedburst);
					if (((StatusEffect)this).Owner.TryGetStatusEffect<splitburstdef.splitburst>(ref splitburstfirst) && !((StatusEffect)this).Owner.TryGetStatusEffect<concentratedburstdef.concentratedburst>(ref concentratedfirst))
					{
						for (int i = ((StatusEffect)splitburstfirst).Level; i >= 0; i--)
						{
							if (!((StatusEffect)this).Battle.BattleShouldEnd)
							{
								yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (IEnumerable<Unit>)((StatusEffect)this).Battle.EnemyGroup.Alives, DamageInfo.Attack((float)Convert.ToInt32(actualdmg / (float)(((StatusEffect)splitburstfirst).Level + 1)), true), "JunkoLunatic", (GunType)0);
							}
						}
					}
					concentratedburstdef.concentratedburst concentratedburst = default(concentratedburstdef.concentratedburst);
					splitburstdef.splitburst splitburst2 = default(splitburstdef.splitburst);
					if (((StatusEffect)this).Owner.TryGetStatusEffect<concentratedburstdef.concentratedburst>(ref concentratedburst))
					{
						int enemycount = 0;
						foreach (EnemyUnit allAliveEnemy in ((StatusEffect)this).Battle.AllAliveEnemies)
						{
							_ = allAliveEnemy;
							enemycount++;
						}
						int conmultiplied = enemycount * ((StatusEffect)concentratedburst).Level;
						splitburstdef.splitburst splitburst = default(splitburstdef.splitburst);
						if (((StatusEffect)this).Owner.TryGetStatusEffect<splitburstdef.splitburst>(ref splitburst))
						{
							int consplit = conmultiplied * (1 + ((StatusEffect)splitburst).Level);
							for (int k = consplit; k > 0; k--)
							{
								if (!((StatusEffect)this).Battle.BattleShouldEnd)
								{
									yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)CollectionsExtensions.SampleOrDefault<EnemyUnit>(((StatusEffect)this).Battle.EnemyGroup.Alives, ((StatusEffect)this).Battle.GameRun.BattleRng), DamageInfo.Attack((float)Convert.ToInt32(actualdmg / (float)(((StatusEffect)splitburst).Level + 1)), true), "JunkoLunaticHit", (GunType)0);
								}
							}
						}
						else
						{
							for (int j = conmultiplied; j > 0; j--)
							{
								if (!((StatusEffect)this).Battle.BattleShouldEnd)
								{
									yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)CollectionsExtensions.SampleOrDefault<EnemyUnit>(((StatusEffect)this).Battle.EnemyGroup.Alives, ((StatusEffect)this).Battle.GameRun.BattleRng), DamageInfo.Attack(actualdmg, true), "JunkoLunaticHit", (GunType)0);
								}
							}
						}
					}
					else if (!((StatusEffect)this).Owner.TryGetStatusEffect<splitburstdef.splitburst>(ref splitburst2) && !((StatusEffect)this).Battle.BattleShouldEnd)
					{
						yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (IEnumerable<Unit>)((StatusEffect)this).Battle.EnemyGroup.Alives, DamageInfo.Attack(actualdmg, true), "JunkoLunatic", (GunType)0);
					}
					everlastingmagicdef.everlastingmagic tmp2 = default(everlastingmagicdef.everlastingmagic);
					if (!((StatusEffect)this).Owner.TryGetStatusEffect<everlastingmagicdef.everlastingmagic>(ref tmp2))
					{
						base.truecounter -= (int)actualdmg;
						actualdmg = 0f;
						yield return (BattleAction)(object)new ApplyStatusEffectAction<magicalburst>(((StatusEffect)this).Owner, (int?)0, (int?)null, (int?)null, (int?)null, 0f, false);
					}
					dealdmgletsgo = false;
					fastburstdef.fastburst effect = default(fastburstdef.fastburst);
					if (((StatusEffect)this).Owner.TryGetStatusEffect<fastburstdef.fastburst>(ref effect))
					{
						yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)effect, true, 0.1f);
					}
				}
				dmgcalc();
			}
		}

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

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(CardConfig)), "", 1, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, true, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string> { "extmpfire" }, "Default", "Default", "Default");
		}
	}
	public sealed class sepassivedef : StatusEffectTemplate
	{
		[EntityLogic(typeof(sepassivedef))]
		public sealed class sepassive : mimaextensions.mimase
		{
		}

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

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("sepassiveandblitz.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(CardConfig)), "", 20, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, true, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class semonsterdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(semonsterdef))]
		public sealed class semonster : mimaextensions.mimase
		{
		}

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

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("sepassiveandblitz.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(CardConfig)), "", 20, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, true, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class seblitzdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(seblitzdef))]
		public sealed class seblitz : mimaextensions.mimase
		{
		}

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

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("sepassiveandblitz.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(CardConfig)), "", 20, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, true, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class sepassiveshopdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(sepassiveshopdef))]
		public sealed class sepassiveshop : mimaextensions.mimase
		{
		}

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

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("sepassiveandblitz.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(CardConfig)), "", 20, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, true, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class seblitzshopdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(seblitzshopdef))]
		public sealed class seblitzshop : mimaextensions.mimase
		{
		}

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

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.sebatchloc.AddEntity((EntityDefinition)(object)this);
		}

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("sepassiveandblitz.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(CardConfig)), "", 20, (StatusEffectType)2, true, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, true, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class RepeatActionSeDef : StatusEffectTemplate
	{
		[EntityLogic(typeof(RepeatActionSeDef))]
		public sealed class RepeatActionSe : mimaextensions.mimase
		{
			private bool Temp = false;

			private Card card;

			private int? activeCost;

			private int? upgradedActiveCost;

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
				((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnStarted, (EventSequencedReactor<UnitEventArgs>)OnPlayerTurnStarted);
			}

			private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
			{
				card = args.Card;
				yield break;
			}

			private IEnumerable<BattleAction> OnPlayerTurnStarted(UnitEventArgs args)
			{
				if (card != null && card.Battle == null)
				{
					card.EnterBattle(((StatusEffect)this).Battle);
					Temp = true;
				}
				if ((int)card.CardType == 5)
				{
					activeCost = card.Config.ActiveCost;
					upgradedActiveCost = card.Config.UpgradedActiveCost;
					card.Config.ActiveCost = 0;
					card.Config.UpgradedActiveCost = 0;
				}
				if (card != null && card.Battle != null && ((GameEntity)card).GameRun != null)
				{
					UnitSelector unitSelector = new UnitSelector(CollectionsExtensions.Sample<EnemyUnit>(((StatusEffect)this).Battle.AllAliveEnemies, ((GameEntity)this).GameRun.BattleRng));
					for (int i = 0; i < ((StatusEffect)this).Level; i++)
					{
						if (!((Unit)unitSelector.SelectedEnemy).IsAlive)
						{
							unitSelector = new UnitSelector(CollectionsExtensions.Sample<EnemyUnit>(((StatusEffect)this).Battle.AllAliveEnemies, ((GameEntity)this).GameRun.BattleRng));
						}
						List<DamageAction> damageActions = new List<DamageAction>();
						switch (card.Config.TargetType)
						{
						case 0L:
							foreach (BattleAction battleAction in card.GetActions(UnitSelector.Nobody, ManaGroup.Empty, card.Precondition(), (IList<DamageAction>)damageActions, card.Summoning))
							{
								DamageAction damageAction = (DamageAction)(object)((battleAction is DamageAction) ? battleAction : null);
								if (damageAction != null)
								{
									damageActions.Add(damageAction);
								}
								yield return battleAction;
							}
							break;
						case 1L:
							foreach (BattleAction battleAction2 in card.GetActions(unitSelector, ManaGroup.Empty, card.Precondition(), (IList<DamageAction>)damageActions, card.Summoning))
							{
								DamageAction damageAction2 = (DamageAction)(object)((battleAction2 is DamageAction) ? battleAction2 : null);
								if (damageAction2 != null)
								{
									damageActions.Add(damageAction2);
								}
								yield return battleAction2;
							}
							break;
						case 2L:
							foreach (BattleAction battleAction3 in card.GetActions(UnitSelector.AllEnemies, ManaGroup.Empty, card.Precondition(), (IList<DamageAction>)damageActions, card.Summoning))
							{
								DamageAction damageAction3 = (DamageAction)(object)((battleAction3 is DamageAction) ? battleAction3 : null);
								if (damageAction3 != null)
								{
									damageActions.Add(damageAction3);
								}
								yield return battleAction3;
							}
							break;
						case 3L:
							foreach (BattleAction battleAction4 in card.GetActions(UnitSelector.RandomEnemy, ManaGroup.Empty, card.Precondition(), (IList<DamageAction>)damageActions, card.Summoning))
							{
								DamageAction damageAction4 = (DamageAction)(object)((battleAction4 is DamageAction) ? battleAction4 : null);
								if (damageAction4 != null)
								{
									damageActions.Add(damageAction4);
								}
								yield return battleAction4;
							}
							break;
						case 4L:
							foreach (BattleAction battleAction5 in card.GetActions(UnitSelector.Self, ManaGroup.Empty, card.Precondition(), (IList<DamageAction>)damageActions, card.Summoning))
							{