Decompiled source of Mima v0.0.40

lvalonmima.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using 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.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 LBoLEntitySideloader;
using LBoLEntitySideloader.Attributes;
using LBoLEntitySideloader.Entities;
using LBoLEntitySideloader.PersistentValues;
using LBoLEntitySideloader.Resource;
using LBoLEntitySideloader.Utils;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.UI;
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.40")]
	[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 int passivegold;

			public override void Restore(GameRunController gameRun)
			{
				PlayerUnit player = gameRun.Player;
				Exhibit exhibit = (Exhibit)(object)player.GetExhibit<mimapassivesdef.mimapassives>();
				if (exhibit != null && exhibit is mimapassivesdef.mimapassives mimapassives)
				{
					mimapassives.passivegold = passivegold;
				}
			}

			public override void Save(GameRunController gameRun)
			{
				PlayerUnit player = gameRun.Player;
				Exhibit exhibit = (Exhibit)(object)player.GetExhibit<mimapassivesdef.mimapassives>();
				if (exhibit != null && exhibit is mimapassivesdef.mimapassives mimapassives)
				{
					passivegold = mimapassives.passivegold;
				}
			}
		}

		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 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();
			((CustomGameRunSaveData)new mimaplayerdata()).RegisterSelf("neo.lbol.frameworks.entitySideloader");
		}

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

		private void Update()
		{
			if (((KeyboardShortcut)(ref TestTab)).IsDown())
			{
				GameMaster instance = Singleton<GameMaster>.Instance;
				if (((instance != null) ? instance.CurrentGameRun : null) != null)
				{
					((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(tabber());
				}
				else
				{
					log.LogInfo((object)"run needs to be started");
				}
			}
		}

		private IEnumerator tabber()
		{
			yield break;
		}
	}
	public class mimaextensions
	{
		public abstract class mimacard : Card
		{
		}

		public abstract class mimaexhibit : Exhibit
		{
		}

		public abstract class mimasexhibit : ShiningExhibit
		{
		}

		public abstract class mimaexpartner : ExtraTurnPartner
		{
		}

		public abstract class mimase : StatusEffect
		{
			public bool isMBmod { get; set; }

			public int truecounter { get; set; }
		}
	}
	public static class PInfo
	{
		public const string GUID = "llbol.ea.mima";

		public const string Name = "llvalonmima";

		public const string version = "0.0.40";

		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_0005: 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_0005: 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_002a: 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 abstract class toolbox
	{
		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)
		{
			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 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_0005: 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_0005: 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 : StatusEffect
		{
			private bool thisround = false;

			protected override void OnAdded(Unit unit)
			{
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e4: Expected O, but got Unknown
				((StatusEffect)this).Count = 1;
				if (((GameEntity)unit).Id == "Mima")
				{
					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);
				if (((GameEntity)unit).Id != "Mima")
				{
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)new ForceKillAction(((StatusEffect)this).Owner, ((StatusEffect)this).Owner)));
					return;
				}
				((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)));
			}

			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)));
					}
					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);
				}
			}
		}

		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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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" }, "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 : StatusEffect
		{
			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_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			return new StatusEffectConfig(0, "", 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 karmanationdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(karmanationdef))]
		public sealed class karmanation : StatusEffect
		{
			public int dmgscale
			{
				get
				{
					if (((GameEntity)this).GameRun == null)
					{
						return 2;
					}
					return (((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 accrealthisturn = false;

			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 ForceNotShowNumber => 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 && mimase.isMBmod)
				{
					((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 && mimase.isMBmod)
				{
					((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)
				{
					base.truecounter += Convert.ToInt32(((StatusEffect)this).Level * ((StatusEffect)everlastingmagic).Level / 5);
				}
				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;
					accrealthisturn = true;
					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 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))
							{
								DamageAction damageAction5 = (DamageAction)(object)((battleAction5 is DamageAction) ? battleAction5 : null);
								if (damageAction5 != null)
								{
									damageActions.Add(damageAction5);
								}
								yield return battleAction5;
							}
							break;
						case 5L:
							foreach (BattleAction battleAction6 in card.GetActions(UnitSelector.All, ManaGroup.Empty, card.Precondition(), (IList<DamageAction>)damageActions, card.Summoning))
							{
								DamageAction damageAction6 = (DamageAction)(object)((battleAction6 is DamageAction) ? battleAction6 : null);
								if (damageAction6 != null)
								{
									damageActions.Add(damageAction6);
								}
								yield return battleAction6;
							}
							break;
						}
					}
					((StatusEffect)this).Battle.PlayerTurnShouldEnd = false;
				}
				if ((int)card.CardType == 5)
				{
					card.Config.ActiveCost = activeCost;
					card.Config.UpgradedActiveCost = upgradedActiveCost;
				}
				if (Temp)
				{
					if (card.Battle != null)
					{
						card.LeaveBattle();
					}
					Temp = false;
				}
			}

			protected override void OnRemoved(Unit unit)
			{
				card = null;
			}
		}

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

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

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(StatusEffectConfig)), "", 10, (StatusEffectType)0, false, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)(StackType)0, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class sedawntimedef : StatusEffectTemplate
	{
		[EntityLogic(typeof(sedawntimedef))]
		public sealed class sedawntime : mimaextensions.mimaexpartner
		{
			public ManaGroup Mana = ManaGroup.Empty;

			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).HandleOwnerEvent<DamageEventArgs>(((StatusEffect)this).Owner.DamageTaking, (GameEventHandler<DamageEventArgs>)OnDamageTaking);
				((StatusEffect)this).HandleOwnerEvent<DamageDealingEventArgs>(((StatusEffect)this).Owner.DamageDealing, (GameEventHandler<DamageDealingEventArgs>)OnDamageDealing);
				((StatusEffect)this).HandleOwnerEvent<CardEventArgs>(((StatusEffect)this).Battle.Predraw, (GameEventHandler<CardEventArgs>)OnPredraw);
				((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((StatusEffect)this).Owner.TurnStarted, (EventSequencedReactor<UnitEventArgs>)OnOwnerTurnStarted);
				((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnEnding, (EventSequencedReactor<UnitEventArgs>)(object)new EventSequencedReactor<GameEventArgs>(OnPlayerTurnEnding));
				((StatusEffect)this).HandleOwnerEvent<ManaEventArgs>(((StatusEffect)this).Battle.ManaGaining, (GameEventHandler<ManaEventArgs>)OnManaGaining);
				CardToFree(((StatusEffect)this).Battle.EnumerateAllCards());
				((StatusEffect)this).HandleOwnerEvent<CardsEventArgs>(((StatusEffect)this).Battle.CardsAddedToDiscard, (GameEventHandler<CardsEventArgs>)OnAddCard);
				((StatusEffect)this).HandleOwnerEvent<CardsEventArgs>(((StatusEffect)this).Battle.CardsAddedToHand, (GameEventHandler<CardsEventArgs>)OnAddCard);
				((StatusEffect)this).HandleOwnerEvent<CardsEventArgs>(((StatusEffect)this).Battle.CardsAddedToExile, (GameEventHandler<CardsEventArgs>)OnAddCard);
				((StatusEffect)this).ReactOwnerEvent<CardMovingEventArgs>(((StatusEffect)this).Battle.CardMoved, (EventSequencedReactor<CardMovingEventArgs>)OnCardMoved);
				((StatusEffect)this).HandleOwnerEvent<CardsAddingToDrawZoneEventArgs>(((StatusEffect)this).Battle.CardsAddedToDrawZone, (GameEventHandler<CardsAddingToDrawZoneEventArgs>)OnAddCardToDraw);
			}

			private void OnDamageTaking(DamageEventArgs args)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				if (((ExtraTurnPartner)this).ThisTurnActivating)
				{
					DamageInfo damageInfo = args.DamageInfo;
					int num = MathExtensions.RoundToInt(((DamageInfo)(ref damageInfo)).Damage);
					if (num > 0)
					{
						((StatusEffect)this).NotifyActivating();
						damageInfo = args.DamageInfo;
						args.DamageInfo = ((DamageInfo)(ref damageInfo)).ReduceActualDamageBy(num);
						((GameEventArgs)args).AddModifier((GameEntity)(object)this);
					}
				}
			}

			private void OnDamageDealing(DamageDealingEventArgs args)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				if (((ExtraTurnPartner)this).ThisTurnActivating)
				{
					DamageInfo damageInfo = args.DamageInfo;
					((DamageInfo)(ref damageInfo)).Damage = ((DamageInfo)(ref damageInfo)).Amount * 0f;
					args.DamageInfo = damageInfo;
					((GameEventArgs)args).AddModifier((GameEntity)(object)this);
				}
			}

			private void OnManaGaining(ManaEventArgs args)
			{
				if (((ExtraTurnPartner)this).ThisTurnActivating)
				{
					((GameEventArgs)args).CancelBy((GameEntity)(object)this);
				}
			}

			private void OnAddCardToDraw(CardsAddingToDrawZoneEventArgs args)
			{
				if (((ExtraTurnPartner)this).ThisTurnActivating)
				{
					CardToFree(args.Cards);
				}
			}

			private void OnAddCard(CardsEventArgs args)
			{
				if (((ExtraTurnPartner)this).ThisTurnActivating)
				{
					CardToFree(args.Cards);
				}
			}

			private IEnumerable<BattleAction> OnCardMoved(CardMovingEventArgs args)
			{
				if (((ExtraTurnPartner)this).ThisTurnActivating)
				{
					Card card = args.Card;
					if (!card.Config.IsXCost)
					{
						card.FreeCost = true;
					}
				}
				yield break;
			}

			private void CardToFree(IEnumerable<Card> cards)
			{
				if (!((ExtraTurnPartner)this).ThisTurnActivating)
				{
					return;
				}
				foreach (Card card in cards)
				{
					if (!card.Config.IsXCost)
					{
						card.FreeCost = true;
					}
				}
			}

			protected override void OnRemoved(Unit unit)
			{
				foreach (Card item in ((StatusEffect)this).Battle.EnumerateAllCards())
				{
					item.FreeCost = false;
				}
			}

			private IEnumerable<BattleAction> OnOwnerTurnStarted(UnitEventArgs args)
			{
				if (!((ExtraTurnPartner)this).ThisTurnActivating)
				{
					yield break;
				}
				List<Card> hand = ((StatusEffect)this).Battle.HandZone.Select((Card card) => card).ToList();
				if (hand.Count > 0)
				{
					foreach (Card card3 in hand)
					{
						yield return (BattleAction)new RemoveCardAction(card3);
					}
				}
				List<Card> list = toolbox.RollCardsCustom(((GameEntity)this).GameRun.BattleCardRng, new CardWeightTable(RarityWeightTable.BattleCard, OwnerWeightTable.OnlyPlayer, CardTypeWeightTable.CanBeLoot), ((StatusEffect)this).Level, null, colorLimit: false, applyFactors: false, battleRolling: false, ensureCount: false, (Card card) => card is mimaextensions.mimacard && !((Enum)card.Keywords).HasFlag((Enum)(object)(Keyword)65536) && card.Config.Id != "carddawntime").ToList();
				if (list.Count <= 0)
				{
					yield break;
				}
				foreach (Card card2 in list)
				{
					ManaGroup turnCost = default(ManaGroup);
					((ManaGroup)(ref turnCost)).Any = 0;
					card2.SetTurnCost(turnCost);
					card2.IsEthereal = true;
					card2.IsExile = true;
				}
				yield return (BattleAction)new AddCardsToHandAction((IEnumerable<Card>)list, (AddCardsType)0);
			}

			private void OnPredraw(CardEventArgs args)
			{
				if (((ExtraTurnPartner)this).ThisTurnActivating)
				{
					((GameEventArgs)args).CancelBy((GameEntity)(object)this);
				}
			}

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

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

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			return new StatusEffectConfig(BepinexPlugin.sequenceTable.Next(typeof(CardConfig)), "", 420, (StatusEffectType)2, true, false, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)null, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)1099512283136L, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class seshepherdgdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(seshepherdgdef))]
		public sealed class seshepherdg : mimaextensions.mimase
		{
			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((StatusEffect)this).Owner.TurnStarted, (EventSequencedReactor<UnitEventArgs>)OnTurnStarted);
			}

			private IEnumerable<BattleAction> OnTurnStarted(UnitEventArgs args)
			{
				if (((StatusEffect)this).Owner != null && !((StatusEffect)this).Battle.BattleShouldEnd)
				{
					<>n__0();
					yield return (BattleAction)(object)DamageAction.LoseLife(((StatusEffect)this).Owner, ((StatusEffect)this).Level, "Poison");
					yield return (BattleAction)(object)new ApplyStatusEffectAction<magicalburstdef.magicalburst>(((StatusEffect)this).Owner, (int?)((StatusEffect)this).Level, (int?)null, (int?)null, (int?)null, 0f, true);
				}
			}

			[CompilerGenerated]
			[DebuggerHidden]
			private void <>n__0()
			{
				((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("seshepherdg");
		}

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("seshepherdg.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)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> { "magicalburst" }, "Default", "Default", "Default");
		}
	}
	public sealed class startturnloselifedef : StatusEffectTemplate
	{
		[EntityLogic(typeof(startturnloselifedef))]
		public sealed class startturnloselife : mimaextensions.mimase
		{
			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((StatusEffect)this).Owner.TurnStarted, (EventSequencedReactor<UnitEventArgs>)OnTurnStarted);
			}

			private IEnumerable<BattleAction> OnTurnStarted(UnitEventArgs args)
			{
				if (!((StatusEffect)this).Battle.BattleShouldEnd)
				{
					<>n__0();
					yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, ((StatusEffect)this).Owner, DamageInfo.HpLose((float)((StatusEffect)this).Level, false), "Instant", (GunType)0);
				}
			}

			[CompilerGenerated]
			[DebuggerHidden]
			private void <>n__0()
			{
				((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("startturnloselife");
		}

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("sestartturnloselife.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)), "", 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>(), "Default", "Default", "Default");
		}
	}
	public sealed class theabyssdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(theabyssdef))]
		public sealed class theabyss : mimaextensions.mimase
		{
			private int cardused = 0;

			public ManaGroup Mana = ManaGroup.Empty;

			protected override void OnAdded(Unit unit)
			{
				CardToFree(((StatusEffect)this).Battle.EnumerateAllCards());
				((StatusEffect)this).ReactOwnerEvent<GameEventArgs>(((StatusEffect)this).Battle.RoundEnding, (EventSequencedReactor<GameEventArgs>)OnRoundEnding);
				((StatusEffect)this).HandleOwnerEvent<CardsEventArgs>(((StatusEffect)this).Battle.CardsAddedToDiscard, (GameEventHandler<CardsEventArgs>)OnAddCard);
				((StatusEffect)this).HandleOwnerEvent<CardsEventArgs>(((StatusEffect)this).Battle.CardsAddedToHand, (GameEventHandler<CardsEventArgs>)OnAddCard);
				((StatusEffect)this).HandleOwnerEvent<CardsEventArgs>(((StatusEffect)this).Battle.CardsAddedToExile, (GameEventHandler<CardsEventArgs>)OnAddCard);
				((StatusEffect)this).HandleOwnerEvent<CardsAddingToDrawZoneEventArgs>(((StatusEffect)this).Battle.CardsAddedToDrawZone, (GameEventHandler<CardsAddingToDrawZoneEventArgs>)OnAddCardToDraw);
				((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(unit, "JingHua", 0f, "", 0f, (EffectBehavior)0, 0f)));
			}

			private void CardToFree(IEnumerable<Card> cards)
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Invalid comparison between Unknown and I4
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				foreach (Card card in cards)
				{
					if ((int)card.CardType == 3)
					{
						ManaGroup baseCost = card.BaseCost;
						if (((ManaGroup)(ref baseCost)).Amount > 2)
						{
							card.FreeCost = true;
						}
					}
				}
			}

			private void OnAddCardToDraw(CardsAddingToDrawZoneEventArgs args)
			{
				CardToFree(args.Cards);
			}

			private void OnAddCard(CardsEventArgs args)
			{
				CardToFree(args.Cards);
			}

			private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
			{
				if ((int)args.Card.CardType == 3)
				{
					cardused = 1;
				}
				yield break;
			}

			protected override void OnRemoved(Unit unit)
			{
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Invalid comparison between Unknown and I4
				foreach (Card item in ((StatusEffect)this).Battle.EnumerateAllCards())
				{
					if ((int)item.CardType == 3)
					{
						item.FreeCost = false;
					}
				}
			}

			private IEnumerable<BattleAction> OnRoundEnding(GameEventArgs args)
			{
				if (cardused == 1)
				{
					int num = ((StatusEffect)this).Level - 1;
					((StatusEffect)this).Level = num;
					cardused = 0;
				}
				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("theabyss");
		}

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

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			return new StatusEffectConfig(0, "", 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)1099511627776L, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public sealed class transcendeddef : StatusEffectTemplate
	{
		[EntityLogic(typeof(transcendeddef))]
		public sealed class transcended : mimaextensions.mimase
		{
			private int cardused = 0;

			public ManaGroup Mana => ManaGroup.Philosophies(1);

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
				((StatusEffect)this).ReactOwnerEvent<GameEventArgs>(((StatusEffect)this).Battle.RoundEnding, (EventSequencedReactor<GameEventArgs>)OnRoundEnding);
				((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)PerformAction.Effect(unit, "JingHua", 0f, "", 0f, (EffectBehavior)0, 0f)));
			}

			private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
			{
				if ((int)args.Card.CardType == 3)
				{
					cardused = 1;
					((StatusEffect)this).NotifyActivating();
					yield return (BattleAction)new GainManaAction(Mana);
				}
			}

			private IEnumerable<BattleAction> OnRoundEnding(GameEventArgs args)
			{
				if (cardused == 1)
				{
					int num = ((StatusEffect)this).Level - 1;
					((StatusEffect)this).Level = num;
					cardused = 0;
				}
				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("transcended");
		}

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("setranscended.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)), "", 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>(), "Default", "Default", "Default");
		}
	}
}
namespace lvalonmima.SE.mburstmodifiers
{
	public sealed class accumulationdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(accumulationdef))]
		public sealed class accumulation : mimaextensions.mimase
		{
			public accumulation()
			{
				base.isMBmod = true;
				base.truecounter = 0;
			}

			protected override void OnAdded(Unit unit)
			{
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Expected O, but got Unknown
				everlastingmagicdef.everlastingmagic everlastingmagic = default(everlastingmagicdef.everlastingmagic);
				if (((StatusEffect)this).Owner.TryGetStatusEffect<everlastingmagicdef.everlastingmagic>(ref everlastingmagic))
				{
					((GameEntity)this).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f)));
				}
				((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(((StatusEffect)this).Owner.StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnStatusEffectAdded);
			}

			private IEnumerable<BattleAction> OnStatusEffectAdded(StatusEffectApplyEventArgs args)
			{
				if (args.Effect is everlastingmagicdef.everlastingmagic)
				{
					((GameEntity)this).NotifyChanged();
					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("accumulation");
		}

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("seaccumulation.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> { "magicalburst" }, "Default", "Default", "Default");
		}
	}
	public sealed class concentratedburstdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(concentratedburstdef))]
		public sealed class concentratedburst : mimaextensions.mimase
		{
			private int enemycount = 0;

			public int showenemycount
			{
				get
				{
					if (((StatusEffect)this).Battle == null)
					{
						return 1;
					}
					return enemycount;
				}
			}

			public concentratedburst()
			{
				base.isMBmod = true;
				base.truecounter = 0;
			}

			protected override void OnAdded(Unit unit)
			{
				foreach (EnemyUnit allAliveEnemy in ((StatusEffect)this).Battle.AllAliveEnemies)
				{
					enemycount++;
				}
				((StatusEffect)this).ReactOwnerEvent<DieEventArgs>(((StatusEffect)this).Battle.EnemyDied, (EventSequencedReactor<DieEventArgs>)OnEnemyDied);
			}

			private IEnumerable<BattleAction> OnEnemyDied(DieEventArgs arg)
			{
				<>n__0();
				enemycount = 0;
				foreach (EnemyUnit allAliveEnemy in ((StatusEffect)this).Battle.AllAliveEnemies)
				{
					_ = allAliveEnemy;
					enemycount++;
				}
				yield break;
			}

			[CompilerGenerated]
			[DebuggerHidden]
			private void <>n__0()
			{
				((StatusEffect)this).NotifyChanged();
			}
		}

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

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("seconcentratedburst.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> { "magicalburst" }, "Default", "Default", "Default");
		}
	}
	public sealed class everlastingmagicdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(everlastingmagicdef))]
		public sealed class everlastingmagic : mimaextensions.mimase
		{
			public int showeverlasting
			{
				get
				{
					if (((GameEntity)this).GameRun == null)
					{
						return 80;
					}
					return (((StatusEffect)this).Level > 5) ? 100 : Convert.ToInt32(((StatusEffect)this).Level * 20);
				}
			}

			public everlastingmagic()
			{
				base.isMBmod = true;
				base.truecounter = 0;
			}

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(((StatusEffect)this).Owner.StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnStatusEffectAdded);
				if (((StatusEffect)this).Level > 5)
				{
					((StatusEffect)this).NotifyChanged();
					((StatusEffect)this).Level = 5;
				}
			}

			private IEnumerable<BattleAction> OnStatusEffectAdded(StatusEffectApplyEventArgs args)
			{
				if (((StatusEffect)this).Level > 5)
				{
					<>n__0();
					((StatusEffect)this).Level = 5;
				}
				yield break;
			}

			[CompilerGenerated]
			[DebuggerHidden]
			private void <>n__0()
			{
				((StatusEffect)this).NotifyChanged();
			}
		}

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

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("seeverlastingmagic.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> { "magicalburst" }, "Default", "Default", "Default");
		}
	}
	public sealed class fastburstdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(fastburstdef))]
		public sealed class fastburst : mimaextensions.mimase
		{
			private bool holup = false;

			public int showfastburst
			{
				get
				{
					if (((GameEntity)this).GameRun == null)
					{
						return 20;
					}
					return (((StatusEffect)this).Level > 5) ? Convert.ToInt32(100) : Convert.ToInt32(((StatusEffect)this).Level * 20);
				}
			}

			public fastburst()
			{
				base.isMBmod = true;
				base.truecounter = 0;
			}

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(((StatusEffect)this).Owner.StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnStatusEffectAdded);
				if (((StatusEffect)this).Level > 5)
				{
					((StatusEffect)this).NotifyChanged();
					((StatusEffect)this).Level = 5;
				}
			}

			private IEnumerable<BattleAction> OnStatusEffectAdded(StatusEffectApplyEventArgs args)
			{
				if (((StatusEffect)this).Level > 5)
				{
					<>n__0();
					((StatusEffect)this).Level = 5;
				}
				yield break;
			}

			[CompilerGenerated]
			[DebuggerHidden]
			private void <>n__0()
			{
				((StatusEffect)this).NotifyChanged();
			}
		}

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

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("sefastburst.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> { "magicalburst" }, "Default", "Default", "Default");
		}
	}
	public sealed class implosiondef : StatusEffectTemplate
	{
		[EntityLogic(typeof(implosiondef))]
		public sealed class implosion : mimaextensions.mimase
		{
			public implosion()
			{
				base.truecounter = 0;
			}

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).ReactOwnerEvent<DamageEventArgs>(((StatusEffect)this).Owner.DamageDealt, (EventSequencedReactor<DamageEventArgs>)OnDamageDealt);
			}

			private IEnumerable<BattleAction> OnDamageDealt(DamageEventArgs args)
			{
				if (!((StatusEffect)this).Battle.BattleShouldEnd && args.Target.IsAlive)
				{
					DamageInfo damageInfo = args.DamageInfo;
					if (((GameEventArgs)args).ActionSource.Id == "magicalburst" && ((DamageInfo)(ref damageInfo)).Damage > 0f)
					{
						<>n__0();
						Unit target = args.Target;
						DamageInfo damageInfo2 = args.DamageInfo;
						yield return (BattleAction)(object)DamageAction.LoseLife(target, (int)(((DamageInfo)(ref damageInfo2)).Damage * (float)((StatusEffect)this).Level), "Cold2");
					}
					damageInfo = default(DamageInfo);
				}
			}

			[CompilerGenerated]
			[DebuggerHidden]
			private void <>n__0()
			{
				((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("implosion");
		}

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("seimplosion.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> { "magicalburst" }, "Default", "Default", "Default");
		}
	}
	public sealed class retributiondef : StatusEffectTemplate
	{
		[EntityLogic(typeof(retributiondef))]
		public sealed class retribution : mimaextensions.mimase
		{
			public retribution()
			{
				base.isMBmod = false;
				base.truecounter = 0;
			}

			protected override void OnAdded(Unit unit)
			{
				((StatusEffect)this).ReactOwnerEvent<DamageEventArgs>(((StatusEffect)this).Owner.DamageDealt, (EventSequencedReactor<DamageEventArgs>)OnDamageDealt);
			}

			private IEnumerable<BattleAction> OnDamageDealt(DamageEventArgs args)
			{
				if (((StatusEffect)this).Battle.BattleShouldEnd)
				{
					yield break;
				}
				GameEntity actionSource = ((GameEventArgs)args).ActionSource;
				StatusEffect statusEffect = (StatusEffect)(object)((actionSource is StatusEffect) ? actionSource : null);
				if (statusEffect != null && statusEffect is magicalburstdef.magicalburst)
				{
					DamageInfo damageInfo = args.DamageInfo;
					if (((DamageInfo)(ref damageInfo)).Damage > 0f)
					{
						<>n__0();
						yield return (BattleAction)(object)DamageAction.LoseLife(((StatusEffect)this).Owner, ((StatusEffect)this).Level, "Cold2");
					}
					damageInfo = default(DamageInfo);
				}
			}

			[CompilerGenerated]
			[DebuggerHidden]
			private void <>n__0()
			{
				((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("retribution");
		}

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("seretribution.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> { "magicalburst" }, "Default", "Default", "Default");
		}
	}
	public sealed class splitburstdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(splitburstdef))]
		public sealed class splitburst : mimaextensions.mimase
		{
			public int splitdmg => (((GameEntity)this).GameRun == null) ? 50 : Convert.ToInt32(100 / (((StatusEffect)this).Level + 1));

			public splitburst()
			{
				base.isMBmod = true;
			}

			protected override void OnAdded(Unit unit)
			{
			}
		}

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

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("sesplitburst.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> { "magicalburst" }, "Default", "Default", "Default");
		}
	}
}
namespace lvalonmima.SE.abandoned
{
	public sealed class damageadderdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(damageadderdef))]
		public sealed class damageadder : StatusEffect
		{
			public override bool ForceNotShowNumber => true;

			protected override void OnAdded(Unit unit)
			{
			}
		}

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

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

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			return new StatusEffectConfig(0, "", 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>(), "Default", "Default", "Default");
		}
	}
	public sealed class damagemultiplierdef : StatusEffectTemplate
	{
		[EntityLogic(typeof(damagemultiplierdef))]
		public sealed class damagemultiplier : StatusEffect
		{
			public override bool ForceNotShowNumber => true;

			protected override void OnAdded(Unit unit)
			{
			}
		}

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

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

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			return new StatusEffectConfig(0, "", 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>(), "Default", "Default", "Default");
		}
	}
}
namespace lvalonmima.NotRelics
{
	public sealed class mimaadef : ExhibitTemplate
	{
		[EntityLogic(typeof(mimaadef))]
		public sealed class mimaa : mimaextensions.mimasexhibit
		{
			private int oghp;

			private int ogmax;

			private int ogdmg;

			public ManaGroup losemana { get; set; }

			protected override void OnAdded(PlayerUnit player)
			{
				GameRunController gameRun = ((GameEntity)this).GameRun;
				int rewardAndShopCardColorLimitFlag = gameRun.RewardAndShopCardColorLimitFlag + 1;
				gameRun.RewardAndShopCardColorLimitFlag = rewardAndShopCardColorLimitFlag;
				((Exhibit)this).HandleGameRunEvent<StationEventArgs>(((GameEntity)this).GameRun.StationEntered, (GameEventHandler<StationEventArgs>)delegate(StationEventArgs args)
				{
					//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
					//IL_0119: Expected O, but got Unknown
					//IL_019f: Unknown result type (might be due to invalid IL or missing references)
					//IL_01ad: Expected O, but got Unknown
					//IL_0235: Unknown result type (might be due to invalid IL or missing references)
					//IL_0243: Expected O, but got Unknown
					Station station = args.Station;
					EntryStation val = (EntryStation)(object)((station is EntryStation) ? station : null);
					if (val != null && CollectionsExtensions.IndexOf<Stage>(((GameEntity)this).GameRun.Stages, ((Station)val).Stage) == 0)
					{
						int num = 12;
						gameRun.RemoveDeckCards(((GameEntity)this).GameRun.BaseDeck.Select((Card card) => card), false);
						List<Card> list = new List<Card>
						{
							(Card)(object)Library.CreateCard<cardchannellingdef.cardchannelling>(),
							(Card)(object)Library.CreateCard<cardmountaindef.cardmountain>(),
							(Card)(object)Library.CreateCard<cardreminidef.cardremini>(),
							(Card)(object)Library.CreateCard<carderosiondef.carderosion>()
						};
						((GameEntity)this).GameRun.AddDeckCards((IEnumerable<Card>)list, false, (VisualSourceData)null);
						for (int i = 0; i < num; i++)
						{
							Card[] array = gameRun.RollCards(gameRun.CardRng, new CardWeightTable(RarityWeightTable.EnemyCard, OwnerWeightTable.OnlyPlayer, CardTypeWeightTable.OnlySkill), 1, false, true, (Predicate<CardConfig>)((CardConfig config) => (int)config.Rarity != 2));
							gameRun.AddDeckCards((IEnumerable<Card>)array, false, (VisualSourceData)null);
						}
						if (((GameEntity)this).GameRun.BaseDeck.Count < num + 4)
						{
							int num2 = num + 4 - ((GameEntity)this).GameRun.BaseDeck.Count;
							for (int j = 0; j < num2; j++)
							{
								Card[] array2 = gameRun.RollCards(gameRun.CardRng, new CardWeightTable(RarityWeightTable.EnemyCard, OwnerWeightTable.OnlyPlayer, CardTypeWeightTable.OnlySkill), 1, false, false, (Predicate<CardConfig>)null);
								gameRun.AddDeckCards((IEnumerable<Card>)array2, false, (VisualSourceData)null);
							}
						}
						if (((GameEntity)this).GameRun.BaseDeck.Count < num + 4)
						{
							int num3 = num + 4 - ((GameEntity)this).GameRun.BaseDeck.Count;
							for (int k = 0; k < num3; k++)
							{
								Card[] array3 = gameRun.RollCards(gameRun.CardRng, new CardWeightTable(RarityWeightTable.OnlyRare, OwnerWeightTable.OnlyPlayer, CardTypeWeightTable.CanBeLoot), 1, false, false, (Predicate<CardConfig>)null);
								gameRun.AddDeckCards((IEnumerable<Ca