Decompiled source of FullElite v1.1.60

FullElite.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AddWatermark;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using DG.Tweening;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
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.Randoms;
using LBoL.Core.Stations;
using LBoL.Core.StatusEffects;
using LBoL.Core.Units;
using LBoL.EntityLib.EnemyUnits.Character;
using LBoL.EntityLib.EnemyUnits.Character.DreamServants;
using LBoL.EntityLib.EnemyUnits.Normal;
using LBoL.EntityLib.EnemyUnits.Normal.Drones;
using LBoL.EntityLib.EnemyUnits.Normal.Guihuos;
using LBoL.EntityLib.EnemyUnits.Normal.Maoyus;
using LBoL.EntityLib.EnemyUnits.Normal.Yinyangyus;
using LBoL.EntityLib.EnemyUnits.Opponent;
using LBoL.EntityLib.Exhibits.Common;
using LBoL.EntityLib.Stages.NormalStages;
using LBoL.EntityLib.StatusEffects.Enemy;
using LBoL.Presentation;
using LBoL.Presentation.UI;
using LBoL.Presentation.UI.Panels;
using LBoL.Presentation.Units;
using LBoLEntitySideloader;
using LBoLEntitySideloader.Attributes;
using LBoLEntitySideloader.BattleModifiers;
using LBoLEntitySideloader.BattleModifiers.Actions;
using LBoLEntitySideloader.Entities;
using LBoLEntitySideloader.ReflectionHelpers;
using LBoLEntitySideloader.Resource;
using UnityEngine;

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

		internal static ManualLogSource log;

		internal static TemplateSequenceTable sequenceTable = new TemplateSequenceTable(0);

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

		internal static DirectorySource directorySource = new DirectorySource("neo.lbol.runmods.fullElite", "");

		internal static BatchLocalization jadeboxBatchLoc = new BatchLocalization(embeddedSource, typeof(JadeBoxTemplate), false);

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

		private void OnDestroy()
		{
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}
	}
	public class EliteModifiers
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static ModPrecond <>9__0_0;

			public static Func<RandomGen> <>9__0_1;

			public static Func<Type, Func<int, ModUnit>> <>9__0_4;

			public static Func<Vector3, ModUnit> <>9__0_5;

			public static Func<Type, string> <>9__0_13;

			public static ModUnit <>9__0_14;

			public static Func<float> <>9__0_15;

			public static ModUnit <>9__0_16;

			public static ModUnit <>9__0_17;

			public static Func<float> <>9__0_18;

			public static ModUnit <>9__0_19;

			public static Func<Type, string> <>9__0_20;

			public static Func<float> <>9__0_21;

			public static ModUnit <>9__0_22;

			public static Func<float> <>9__0_23;

			public static ModUnit <>9__0_6;

			public static Func<float, ModUnit> <>9__0_7;

			public static Func<Type, string> <>9__0_27;

			public static ModUnit <>9__0_28;

			public static Func<float> <>9__0_29;

			public static ModUnit <>9__0_30;

			public static Func<float> <>9__0_31;

			internal bool <Innitialize>b__0_0(Unit unit)
			{
				return VanillaElites.eliteGroups.Contains(unit.Battle.EnemyGroup.Id);
			}

			internal RandomGen <Innitialize>b__0_1()
			{
				return Singleton<GameMaster>.Instance.CurrentGameRun.EnemyBattleRng;
			}

			internal Func<int, ModUnit> <Innitialize>b__0_4(Type se)
			{
				return new <>c__DisplayClass0_3
				{
					se = se
				}.<Innitialize>b__10;
			}

			internal ModUnit <Innitialize>b__0_5(Vector3 targetPos)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Expected O, but got Unknown
				return new ModUnit(new <>c__DisplayClass0_4
				{
					targetPos = targetPos
				}.<Innitialize>b__11);
			}

			internal string <Innitialize>b__0_13(Type t)
			{
				return t.Name;
			}

			internal Unit <Innitialize>b__0_14(Unit unit)
			{
				GuihuoRed val = (GuihuoRed)(object)((unit is GuihuoRed) ? unit : null);
				if (val != null)
				{
					((Guihuo)val).NoDebuffMove = false;
				}
				return unit;
			}

			internal float <Innitialize>b__0_15()
			{
				return Random.Range(1.2f, 1.4f);
			}

			internal Unit <Innitialize>b__0_16(Unit unit)
			{
				LightFairy val = (LightFairy)(object)((unit is LightFairy) ? unit : null);
				if (val != null)
				{
					val.Next = (MoveType)2;
				}
				return unit;
			}

			internal Unit <Innitialize>b__0_17(Unit unit)
			{
				GuihuoRed val = (GuihuoRed)(object)((unit is GuihuoRed) ? unit : null);
				if (val != null)
				{
					((Guihuo)val).NoDebuffMove = false;
					((Guihuo)val).Next = (MoveType)1;
				}
				return unit;
			}

			internal float <Innitialize>b__0_18()
			{
				return Random.Range(1.5f, 1.85f);
			}

			internal Unit <Innitialize>b__0_19(Unit unit)
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new ModifyBlockShield(unit, 35, 0, 1f, true)));
				return unit;
			}

			internal string <Innitialize>b__0_20(Type t)
			{
				return t.Name;
			}

			internal float <Innitialize>b__0_21()
			{
				return Random.Range(0.85f, 0.95f);
			}

			internal Unit <Innitialize>b__0_22(Unit unit)
			{
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Expected O, but got Unknown
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Expected O, but got Unknown
				//IL_007b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Expected O, but got Unknown
				TerminatorElite val = (TerminatorElite)(object)((unit is TerminatorElite) ? unit : null);
				DroneBlock val2 = default(DroneBlock);
				if (((Unit)val).TryGetStatusEffect<DroneBlock>(ref val2))
				{
					((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)val2, true, 0.1f)));
					((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new ModifyBlockShield(unit, 0, 0, 0f, true)));
					((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new ApplySEnoTriggers(typeof(DroneBlock), unit, (int?)10, (int?)null, (int?)null, (int?)null, 0f, true)));
				}
				return unit;
			}

			internal float <Innitialize>b__0_23()
			{
				return Random.Range(1.5f, 1.85f);
			}

			internal Unit <Innitialize>b__0_6(Unit unit)
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Expected O, but got Unknown
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Expected O, but got Unknown
				Doremy val = (Doremy)(object)((unit is Doremy) ? unit : null);
				if (((val != null) ? val.Sleep : null) != null)
				{
					((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction(val.Sleep, true, 0.1f)));
					Type typeFromHandle = typeof(Sleep);
					int? num = unit.Shield;
					int? num2 = 3;
					ApplySEnoTriggers val2 = new ApplySEnoTriggers(typeFromHandle, unit, num, (int?)null, num2, (int?)null, 0f, true);
					((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)(object)val2));
					val.Sleep = ((EventBattleAction<StatusEffectApplyEventArgs>)(object)val2).Args.Effect;
				}
				return unit;
			}

			internal ModUnit <Innitialize>b__0_7(float mul)
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Expected O, but got Unknown
				return new ModUnit(new <>c__DisplayClass0_6
				{
					mul = mul
				}.<Innitialize>b__24);
			}

			internal string <Innitialize>b__0_27(Type t)
			{
				return t.Name;
			}

			internal Unit <Innitialize>b__0_28(Unit aya)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Expected O, but got Unknown
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Expected O, but got Unknown
				FastAttack val = default(FastAttack);
				if (aya.TryGetStatusEffect<FastAttack>(ref val))
				{
					((GameEntity)aya).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)val, true, 0.1f)));
					((GameEntity)aya).React(Reactor.op_Implicit((BattleAction)new ApplySEnoTriggers(typeof(FastAttack), aya, (int?)10, (int?)null, (int?)null, (int?)null, 0f, true)));
				}
				return aya;
			}

			internal float <Innitialize>b__0_29()
			{
				return Random.Range(0.55f, 0.65f);
			}

			internal Unit <Innitialize>b__0_30(Unit aya)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Expected O, but got Unknown
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Expected O, but got Unknown
				FastAttack val = default(FastAttack);
				if (aya.TryGetStatusEffect<FastAttack>(ref val))
				{
					((GameEntity)aya).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)val, true, 0.1f)));
					((GameEntity)aya).React(Reactor.op_Implicit((BattleAction)new ApplySEnoTriggers(typeof(FastAttack), aya, (int?)15, (int?)null, (int?)null, (int?)null, 0f, true)));
				}
				return aya;
			}

			internal float <Innitialize>b__0_31()
			{
				return Random.Range(0.88f, 0.95f);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_3
		{
			public Type se;

			internal ModUnit <Innitialize>b__10(int level)
			{
				return ModFactory.AddSE(se, (int?)level, (int?)null, (int?)null, (int?)null, 0f, true);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_4
		{
			public Vector3 targetPos;

			internal Unit <Innitialize>b__11(Unit unit)
			{
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Expected O, but got Unknown
				<>c__DisplayClass0_5 CS$<>8__locals0 = new <>c__DisplayClass0_5
				{
					uv = (UnitView)/*isinst with value type is only supported in some contexts*/,
					scale = Random.Range(1.5f, 1.85f)
				};
				UnitView uv = CS$<>8__locals0.uv;
				if (uv != null)
				{
					TweenSettingsExtensions.OnComplete<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMove(((Component)uv).transform, targetPos + new Vector3(0f, Random.Range(-0.1f, 0.1f)), 1.3f, false), (Ease)5), (TweenCallback)delegate
					{
						//IL_0039: Unknown result type (might be due to invalid IL or missing references)
						CS$<>8__locals0.uv.PlayEffectOneShot("BuffRed", 0f);
						AudioManager.PlaySfx("Buff");
						ShortcutExtensions.DOScale(((Component)CS$<>8__locals0.uv).transform, new Vector3(CS$<>8__locals0.scale, CS$<>8__locals0.scale), 0.3f);
					});
				}
				return unit;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_5
		{
			public UnitView uv;

			public float scale;

			internal void <Innitialize>b__12()
			{
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				uv.PlayEffectOneShot("BuffRed", 0f);
				AudioManager.PlaySfx("Buff");
				ShortcutExtensions.DOScale(((Component)uv).transform, new Vector3(scale, scale), 0.3f);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_6
		{
			public float mul;

			internal Unit <Innitialize>b__24(Unit unit)
			{
				<>c__DisplayClass0_7 CS$<>8__locals0 = new <>c__DisplayClass0_7
				{
					CS$<>8__locals3 = this,
					doremy = (Doremy)(object)((unit is Doremy) ? unit : null)
				};
				unit.HandleBattleEvent<BlockShieldEventArgs>(unit.BlockShieldGaining, (GameEventHandler<BlockShieldEventArgs>)delegate(BlockShieldEventArgs args)
				{
					if (((GameEventArgs)args).ActionSource != CS$<>8__locals0.doremy.Sleep)
					{
						args.Shield *= CS$<>8__locals0.CS$<>8__locals3.mul;
					}
				});
				unit.HandleBattleEvent<StatusEffectApplyEventArgs>(unit.StatusEffectAdding, (GameEventHandler<StatusEffectApplyEventArgs>)delegate(StatusEffectApplyEventArgs args)
				{
					if (args.Unit == CS$<>8__locals0.doremy && args.Effect is Sleep)
					{
						args.Effect.Level = (int)Math.Round((float)args.Effect.Level * CS$<>8__locals0.CS$<>8__locals3.mul);
					}
				});
				Doremy_Hp_Patch.MulStore.SetHpGainMul(CS$<>8__locals0.doremy, mul);
				return unit;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_7
		{
			public Doremy doremy;

			public <>c__DisplayClass0_6 CS$<>8__locals3;

			internal void <Innitialize>b__25(BlockShieldEventArgs args)
			{
				if (((GameEventArgs)args).ActionSource != doremy.Sleep)
				{
					args.Shield *= CS$<>8__locals3.mul;
				}
			}

			internal void <Innitialize>b__26(StatusEffectApplyEventArgs args)
			{
				if (args.Unit == doremy && args.Effect is Sleep)
				{
					args.Effect.Level = (int)Math.Round((float)args.Effect.Level * CS$<>8__locals3.mul);
				}
			}
		}

		public static void Innitialize()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Expected O, but got Unknown
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Expected O, but got Unknown
			//IL_0773: Unknown result type (might be due to invalid IL or missing references)
			//IL_077a: Expected O, but got Unknown
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Expected O, but got Unknown
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b75: Expected O, but got Unknown
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ac: Expected O, but got Unknown
			//IL_098b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0990: Unknown result type (might be due to invalid IL or missing references)
			//IL_0996: Expected O, but got Unknown
			//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b8: Expected O, but got Unknown
			//IL_0bdb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be2: Expected O, but got Unknown
			//IL_04db: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e6: Expected O, but got Unknown
			//IL_0dcd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd8: Expected O, but got Unknown
			//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0702: Unknown result type (might be due to invalid IL or missing references)
			//IL_0708: Expected O, but got Unknown
			//IL_0e78: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e7f: Expected O, but got Unknown
			//IL_0f6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f7a: Expected O, but got Unknown
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				ModPrecond val = (Unit unit) => VanillaElites.eliteGroups.Contains(unit.Battle.EnemyGroup.Id);
				<>c.<>9__0_0 = val;
				obj = (object)val;
			}
			ModPrecond item = (ModPrecond)obj;
			Func<RandomGen> getRng = () => Singleton<GameMaster>.Instance.CurrentGameRun.EnemyBattleRng;
			Func<int, int, Func<int>> func = (int l, int u) => () => getRng().NextInt(l, u);
			Func<float, float, Func<float>> func2 = (float l, float u) => () => getRng().NextFloat(l, u);
			Func<Type, Func<int, ModUnit>> func3 = (Type se) => (int level) => ModFactory.AddSE(se, (int?)level, (int?)null, (int?)null, (int?)null, 0f, true);
			ModPrecond item2 = PrecondFactory.HasJadeboxes(new HashSet<string> { IdContainer.op_Implicit(((EntityDefinition)new RainbowFullEliteJadeboxDef()).UniqueId) });
			Func<Vector3, ModUnit> func4 = (Vector3 targetPos) => (ModUnit)delegate(Unit unit)
			{
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Expected O, but got Unknown
				UnitView uv = default(UnitView);
				ref UnitView reference = ref uv;
				IUnitView view = unit.View;
				reference = (UnitView)(object)((view is UnitView) ? view : null);
				float scale = Random.Range(1.5f, 1.85f);
				UnitView obj10 = uv;
				if (obj10 != null)
				{
					TweenSettingsExtensions.OnComplete<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMove(((Component)obj10).transform, targetPos + new Vector3(0f, Random.Range(-0.1f, 0.1f)), 1.3f, false), (Ease)5), (TweenCallback)delegate
					{
						//IL_0039: Unknown result type (might be due to invalid IL or missing references)
						uv.PlayEffectOneShot("BuffRed", 0f);
						AudioManager.PlaySfx("Buff");
						ShortcutExtensions.DOScale(((Component)uv).transform, new Vector3(scale, scale), 0.3f);
					});
				}
				return unit;
			};
			foreach (string item3 in VanillaElites.act1.Select((Type t) => t.Name))
			{
				UnitModifier val2 = new UnitModifier(item3, false);
				val2.preconds.Add(item);
				val2.preconds.Add(item2);
				val2.preconds.Add(PrecondFactory.IsStage(typeof(XuanwuRavine)));
				if (!VanillaElites.spirits.Contains(item3))
				{
					val2.mods.Add(ModFactory.AddSE(typeof(Firepower), (int?)3, (int?)null, (int?)null, (int?)null, 0f, true));
					val2.mods.Add(ModFactory.LazyArg<float>(func2(1.7f, 1.9f), (Func<float, ModUnit>)ModFactory.MulEffetiveHp));
				}
				else
				{
					val2.mods.Add(ModFactory.LazyArg<int>(func(1, 2), func3(typeof(Firepower))));
					if (item3 == "GuihuoRed")
					{
						List<ModUnit> mods = val2.mods;
						object obj2 = <>c.<>9__0_14;
						if (obj2 == null)
						{
							ModUnit val3 = delegate(Unit unit)
							{
								GuihuoRed val25 = (GuihuoRed)(object)((unit is GuihuoRed) ? unit : null);
								if (val25 != null)
								{
									((Guihuo)val25).NoDebuffMove = false;
								}
								return unit;
							};
							<>c.<>9__0_14 = val3;
							obj2 = (object)val3;
						}
						mods.Add(ModFactory.DoSomeAction((ModUnit)obj2));
					}
				}
				if (item3 != "Sunny" && item3 != "Luna" && item3 != "Star")
				{
					val2.mods.Add(ModFactory.LazyArg<float>((Func<float>)(() => Random.Range(1.2f, 1.4f)), (Func<float, ModUnit>)ModFactory.ScaleModel));
				}
				if (item3 == "Aya")
				{
					val2.mods.Add(ModFactory.AddSE<FastAttack>((int?)5, (int?)null, (int?)null, (int?)null, 0f, true));
					val2.mods.Add(ModFactory.MultiplyHp(1.15f, false));
				}
				UnitModifier val4 = new UnitModifier(item3, false);
				val4.preconds.Add(item);
				val4.preconds.Add(item2);
				val4.preconds.Add(PrecondFactory.IsStage(typeof(WindGodLake)));
				if (item3 == "Sunny")
				{
					val4.mods.Add(func4(new Vector3(-3f, 0f)));
				}
				if (item3 == "Luna")
				{
					val4.mods.Add(func4(new Vector3(-2.7f, -1.7f)));
				}
				if (item3 == "Star")
				{
					val4.mods.Add(func4(new Vector3(0f, 1.45f)));
				}
				if (!VanillaElites.spirits.Contains(item3))
				{
					if (item3 != "Sunny" && item3 != "Luna" && item3 != "Star")
					{
						val4.mods.Add(ModFactory.AddSE(typeof(Firepower), (int?)5, (int?)null, (int?)null, (int?)null, 0f, true));
					}
					else
					{
						val4.mods.Add(ModFactory.LazyArg<int>(func(5, 7), func3(typeof(Firepower))));
						List<ModUnit> mods2 = val4.mods;
						object obj3 = <>c.<>9__0_16;
						if (obj3 == null)
						{
							ModUnit val5 = delegate(Unit unit)
							{
								LightFairy val24 = (LightFairy)(object)((unit is LightFairy) ? unit : null);
								if (val24 != null)
								{
									val24.Next = (MoveType)2;
								}
								return unit;
							};
							<>c.<>9__0_16 = val5;
							obj3 = (object)val5;
						}
						mods2.Add(ModFactory.DoSomeAction((ModUnit)obj3));
					}
					val4.mods.Add(ModFactory.LazyArg<float>(func2(2.1f, 2.3f), (Func<float, ModUnit>)ModFactory.MulEffetiveHp));
				}
				else
				{
					val4.mods.Add(ModFactory.LazyArg<float>(func2(1.05f, 1.2f), (Func<float, ModUnit>)ModFactory.MulEffetiveHp));
					val4.mods.Add(ModFactory.LazyArg<int>(func(2, 5), func3(typeof(Firepower))));
					if (item3 == "GuihuoRed")
					{
						List<ModUnit> mods3 = val4.mods;
						object obj4 = <>c.<>9__0_17;
						if (obj4 == null)
						{
							ModUnit val6 = delegate(Unit unit)
							{
								GuihuoRed val23 = (GuihuoRed)(object)((unit is GuihuoRed) ? unit : null);
								if (val23 != null)
								{
									((Guihuo)val23).NoDebuffMove = false;
									((Guihuo)val23).Next = (MoveType)1;
								}
								return unit;
							};
							<>c.<>9__0_17 = val6;
							obj4 = (object)val6;
						}
						mods3.Add(ModFactory.DoSomeAction((ModUnit)obj4));
					}
				}
				if (item3 != "Sunny" && item3 != "Luna" && item3 != "Star")
				{
					val4.mods.Add(ModFactory.LazyArg<float>((Func<float>)(() => Random.Range(1.5f, 1.85f)), (Func<float, ModUnit>)ModFactory.ScaleModel));
				}
				if (item3 == "Aya")
				{
					val4.mods.Add(ModFactory.LazyArg<int>(func(7, 11), func3(typeof(FastAttack))));
					val4.mods.Add(ModFactory.LazyArg<int>(func(1, 2), func3(typeof(WindGirl))));
					val4.mods.Add(ModFactory.MultiplyHp(1.2f, false));
					val4.mods.Add(ModFactory.ScaleModel(0.3f));
				}
				if (!(item3 == "Rin"))
				{
					continue;
				}
				List<ModUnit> mods4 = val4.mods;
				object obj5 = <>c.<>9__0_19;
				if (obj5 == null)
				{
					ModUnit val7 = delegate(Unit unit)
					{
						//IL_000c: Unknown result type (might be due to invalid IL or missing references)
						//IL_0016: Expected O, but got Unknown
						((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new ModifyBlockShield(unit, 35, 0, 1f, true)));
						return unit;
					};
					<>c.<>9__0_19 = val7;
					obj5 = (object)val7;
				}
				mods4.Add(ModFactory.DoSomeAction((ModUnit)obj5));
			}
			foreach (string item4 in VanillaElites.act2.Select((Type t) => t.Name))
			{
				UnitModifier val8 = new UnitModifier(item4, false);
				val8.preconds.Add(item);
				val8.preconds.Add(item2);
				val8.preconds.Add(PrecondFactory.IsStage(typeof(BambooForest)));
				if (item4 == "Nitori")
				{
					val8.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), (int?)4, (int?)null, (int?)null, (int?)null, 0f, true));
					val8.mods.Add(ModFactory.LazyArg<float>(func2(0.45f, 0.5f), (Func<float, ModUnit>)ModFactory.MulEffetiveHp));
				}
				else
				{
					if (item4 != "Youmu")
					{
						val8.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), (int?)3, (int?)null, (int?)null, (int?)null, 0f, true));
					}
					val8.mods.Add(ModFactory.LazyArg<float>(func2(0.48f, 0.55f), (Func<float, ModUnit>)ModFactory.MulEffetiveHp));
				}
				if (item4 == "Youmu")
				{
					val8.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), (int?)4, (int?)null, (int?)null, (int?)null, 0f, true));
				}
				val8.mods.Add(ModFactory.LazyArg<float>((Func<float>)(() => Random.Range(0.85f, 0.95f)), (Func<float, ModUnit>)ModFactory.ScaleModel));
				if (item4 == "TerminatorElite")
				{
					List<ModUnit> mods5 = val8.mods;
					object obj6 = <>c.<>9__0_22;
					if (obj6 == null)
					{
						ModUnit val9 = delegate(Unit unit)
						{
							//IL_001d: Unknown result type (might be due to invalid IL or missing references)
							//IL_0027: Expected O, but got Unknown
							//IL_0037: Unknown result type (might be due to invalid IL or missing references)
							//IL_0041: Expected O, but got Unknown
							//IL_007b: Unknown result type (might be due to invalid IL or missing references)
							//IL_0085: Expected O, but got Unknown
							TerminatorElite val21 = (TerminatorElite)(object)((unit is TerminatorElite) ? unit : null);
							DroneBlock val22 = default(DroneBlock);
							if (((Unit)val21).TryGetStatusEffect<DroneBlock>(ref val22))
							{
								((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)val22, true, 0.1f)));
								((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new ModifyBlockShield(unit, 0, 0, 0f, true)));
								((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new ApplySEnoTriggers(typeof(DroneBlock), unit, (int?)10, (int?)null, (int?)null, (int?)null, 0f, true)));
							}
							return unit;
						};
						<>c.<>9__0_22 = val9;
						obj6 = (object)val9;
					}
					mods5.Add(ModFactory.DoSomeAction((ModUnit)obj6));
				}
				UnitModifier val10 = new UnitModifier(item4, false);
				val10.preconds.Add(item);
				val10.preconds.Add(item2);
				val10.preconds.Add(PrecondFactory.IsStage(typeof(WindGodLake)));
				if (item4 == "Youmu")
				{
					val10.mods.Add(ModFactory.AddSE(typeof(LouguanJianSe), (int?)1, (int?)null, (int?)null, (int?)null, 0f, true));
				}
				else
				{
					val10.mods.Add(ModFactory.AddSE(typeof(Firepower), (int?)3, (int?)null, (int?)null, (int?)null, 0f, true));
				}
				if (VanillaElites.masks.Contains(item4))
				{
					val10.mods.Add(ModFactory.LazyArg<float>(func2(1.4f, 1.7f), (Func<float, ModUnit>)ModFactory.MulEffetiveHp));
					continue;
				}
				val10.mods.Add(ModFactory.LazyArg<float>(func2(1.7f, 1.9f), (Func<float, ModUnit>)ModFactory.MulEffetiveHp));
				val10.mods.Add(ModFactory.LazyArg<float>((Func<float>)(() => Random.Range(1.5f, 1.85f)), (Func<float, ModUnit>)ModFactory.ScaleModel));
			}
			object obj7 = <>c.<>9__0_6;
			if (obj7 == null)
			{
				ModUnit val11 = delegate(Unit unit)
				{
					//IL_0029: Unknown result type (might be due to invalid IL or missing references)
					//IL_0033: Expected O, but got Unknown
					//IL_0072: Unknown result type (might be due to invalid IL or missing references)
					//IL_0078: Expected O, but got Unknown
					Doremy val19 = (Doremy)(object)((unit is Doremy) ? unit : null);
					if (((val19 != null) ? val19.Sleep : null) != null)
					{
						((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction(val19.Sleep, true, 0.1f)));
						Type typeFromHandle = typeof(Sleep);
						int? num = unit.Shield;
						int? num2 = 3;
						ApplySEnoTriggers val20 = new ApplySEnoTriggers(typeFromHandle, unit, num, (int?)null, num2, (int?)null, 0f, true);
						((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)(object)val20));
						val19.Sleep = ((EventBattleAction<StatusEffectApplyEventArgs>)(object)val20).Args.Effect;
					}
					return unit;
				};
				<>c.<>9__0_6 = val11;
				obj7 = (object)val11;
			}
			ModUnit val12 = (ModUnit)obj7;
			Func<float, ModUnit> func5 = (float mul) => (ModUnit)delegate(Unit unit)
			{
				Doremy doremy = (Doremy)(object)((unit is Doremy) ? unit : null);
				unit.HandleBattleEvent<BlockShieldEventArgs>(unit.BlockShieldGaining, (GameEventHandler<BlockShieldEventArgs>)delegate(BlockShieldEventArgs args)
				{
					if (((GameEventArgs)args).ActionSource != doremy.Sleep)
					{
						args.Shield *= mul;
					}
				});
				unit.HandleBattleEvent<StatusEffectApplyEventArgs>(unit.StatusEffectAdding, (GameEventHandler<StatusEffectApplyEventArgs>)delegate(StatusEffectApplyEventArgs args)
				{
					if (args.Unit == doremy && args.Effect is Sleep)
					{
						args.Effect.Level = (int)Math.Round((float)args.Effect.Level * mul);
					}
				});
				Doremy_Hp_Patch.MulStore.SetHpGainMul(doremy, mul);
				return unit;
			};
			foreach (string item5 in VanillaElites.act3.Select((Type t) => t.Name))
			{
				UnitModifier val13 = new UnitModifier(item5, false);
				val13.preconds.Add(item);
				val13.preconds.Add(item2);
				val13.preconds.Add(PrecondFactory.IsStage(typeof(BambooForest)));
				val13.mods.Add(ModFactory.LazyArg<float>(func2(0.28f, 0.33f), (Func<float, ModUnit>)ModFactory.MulEffetiveHp));
				if (VanillaElites.eikiSummons.Contains(item5))
				{
					val13.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), (int?)4, (int?)null, (int?)null, (int?)null, 0f, true));
				}
				else if (item5 == "Doremy")
				{
					val13.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), (int?)7, (int?)null, (int?)null, (int?)null, 0f, true));
					val13.mods.Add(ModFactory.DoSomeAction(val12));
					val13.mods.Add(ModFactory.DoSomeAction(ModFactory.LazyArg<float>(func2(0.28f, 0.31f), func5)));
					val13.mods.Add(ModFactory.MultiplyHp(0.95f, false));
				}
				else
				{
					val13.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), (int?)5, (int?)null, (int?)null, (int?)null, 0f, true));
				}
				if (item5 == "DreamAya")
				{
					List<ModUnit> mods6 = val13.mods;
					object obj8 = <>c.<>9__0_28;
					if (obj8 == null)
					{
						ModUnit val14 = delegate(Unit aya)
						{
							//IL_0016: Unknown result type (might be due to invalid IL or missing references)
							//IL_0020: Expected O, but got Unknown
							//IL_005a: Unknown result type (might be due to invalid IL or missing references)
							//IL_0064: Expected O, but got Unknown
							FastAttack val18 = default(FastAttack);
							if (aya.TryGetStatusEffect<FastAttack>(ref val18))
							{
								((GameEntity)aya).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)val18, true, 0.1f)));
								((GameEntity)aya).React(Reactor.op_Implicit((BattleAction)new ApplySEnoTriggers(typeof(FastAttack), aya, (int?)10, (int?)null, (int?)null, (int?)null, 0f, true)));
							}
							return aya;
						};
						<>c.<>9__0_28 = val14;
						obj8 = (object)val14;
					}
					mods6.Add(ModFactory.DoSomeAction((ModUnit)obj8));
				}
				if (item5 == "Clownpiece")
				{
					val13.mods.Add(ModFactory.MultiplyHp(1.15f, false));
				}
				if (item5 == "Doremy")
				{
					val13.mods.Add(ModFactory.ScaleModel(0.7f));
				}
				else
				{
					val13.mods.Add(ModFactory.LazyArg<float>((Func<float>)(() => Random.Range(0.55f, 0.65f)), (Func<float, ModUnit>)ModFactory.ScaleModel));
				}
				UnitModifier val15 = new UnitModifier(item5, false);
				val15.preconds.Add(item);
				val15.preconds.Add(item2);
				val15.preconds.Add(PrecondFactory.IsStage(typeof(XuanwuRavine)));
				val15.mods.Add(ModFactory.LazyArg<float>(func2(0.48f, 0.55f), (Func<float, ModUnit>)ModFactory.MulEffetiveHp));
				if (VanillaElites.dreamGirls.Contains(item5))
				{
					val15.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), (int?)2, (int?)null, (int?)null, (int?)null, 0f, true));
					if (item5 == "DreamAya")
					{
						List<ModUnit> mods7 = val15.mods;
						object obj9 = <>c.<>9__0_30;
						if (obj9 == null)
						{
							ModUnit val16 = delegate(Unit aya)
							{
								//IL_0016: Unknown result type (might be due to invalid IL or missing references)
								//IL_0020: Expected O, but got Unknown
								//IL_005a: Unknown result type (might be due to invalid IL or missing references)
								//IL_0064: Expected O, but got Unknown
								FastAttack val17 = default(FastAttack);
								if (aya.TryGetStatusEffect<FastAttack>(ref val17))
								{
									((GameEntity)aya).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)val17, true, 0.1f)));
									((GameEntity)aya).React(Reactor.op_Implicit((BattleAction)new ApplySEnoTriggers(typeof(FastAttack), aya, (int?)15, (int?)null, (int?)null, (int?)null, 0f, true)));
								}
								return aya;
							};
							<>c.<>9__0_30 = val16;
							obj9 = (object)val16;
						}
						mods7.Add(ModFactory.DoSomeAction((ModUnit)obj9));
					}
				}
				else if (item5 == "Doremy")
				{
					val15.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), (int?)5, (int?)null, (int?)null, (int?)null, 0f, true));
					val15.mods.Add(ModFactory.DoSomeAction(val12));
					val15.mods.Add(ModFactory.DoSomeAction(ModFactory.LazyArg<float>(func2(0.67f, 0.7f), func5)));
				}
				else
				{
					val15.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), (int?)3, (int?)null, (int?)null, (int?)null, 0f, true));
				}
				if (item5 == "Clownpiece")
				{
					val15.mods.Add(ModFactory.MultiplyHp(1.27f, false));
				}
				if (item5 == "Doremy")
				{
					val13.mods.Add(ModFactory.ScaleModel(0.95f));
					continue;
				}
				val15.mods.Add(ModFactory.LazyArg<float>((Func<float>)(() => Random.Range(0.88f, 0.95f)), (Func<float, ModUnit>)ModFactory.ScaleModel));
			}
		}
	}
	[HarmonyPatch]
	internal class Doremy_Hp_Patch
	{
		public class MulStore
		{
			public float mul = 1f;

			public static bool SetHpGainMul(Doremy doremy, float mul)
			{
				try
				{
					MulStore orCreateValue = mulTable.GetOrCreateValue(doremy);
					orCreateValue.mul = mul;
				}
				catch (Exception)
				{
					BepinexPlugin.log.LogWarning((object)$"Could not set hp multiplier for: {doremy}");
					return false;
				}
				return true;
			}
		}

		public static ConditionalWeakTable<Doremy, MulStore> mulTable = new ConditionalWeakTable<Doremy, MulStore>();

		private static IEnumerable<MethodBase> TargetMethods()
		{
			yield return ExtraAccess.InnerMoveNext(typeof(Doremy), "SleepActions");
		}

		private static int ApplyMul(int target, Doremy doremy)
		{
			int result = target;
			if (mulTable.TryGetValue(doremy, out var value))
			{
				result = (int)Math.Round((float)target * value.mul);
			}
			return result;
		}

		private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Expected O, but got Unknown
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Expected O, but got Unknown
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			return new CodeMatcher(instructions, generator).MatchForward(true, (CodeMatch[])(object)new CodeMatch[2]
			{
				new CodeMatch(new CodeInstruction(OpCodes.Call, (object)AccessTools.PropertyGetter(typeof(Unit), "Hp")), (string)null),
				new CodeMatch((OpCode?)OpCodes.Ldc_I4_S, (object)null, (string)null)
			}).Advance(1).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
			{
				new CodeInstruction(OpCodes.Ldloc_2, (object)null)
			})
				.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
				{
					new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Doremy_Hp_Patch), "ApplyMul", (Type[])null, (Type[])null))
				})
				.MatchForward(true, (CodeMatch[])(object)new CodeMatch[2]
				{
					new CodeMatch(new CodeInstruction(OpCodes.Call, (object)AccessTools.PropertyGetter(typeof(Unit), "MaxHp")), (string)null),
					new CodeMatch((OpCode?)OpCodes.Ldc_I4_S, (object)null, (string)null)
				})
				.Advance(1)
				.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
				{
					new CodeInstruction(OpCodes.Ldloc_2, (object)null)
				})
				.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
				{
					new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Doremy_Hp_Patch), "ApplyMul", (Type[])null, (Type[])null))
				})
				.InstructionEnumeration();
		}
	}
	public abstract class BaseFullEliteJadeBoxDef : JadeBoxTemplate
	{
		public const string JdBoxGroup = "FullElite";

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

		public override JadeBoxConfig MakeConfig()
		{
			JadeBoxConfig val = ((JadeBoxTemplate)this).DefaultConfig();
			val.Group = new List<string> { "FullElite" };
			val.Value1 = 4;
			val.Value2 = 50;
			return val;
		}
	}
	public class BaseFullElite : JadeBox
	{
		protected Stage PoolElites(IEnumerable<string> elites, Stage stage)
		{
			stage.EnemyPoolAct1 = new UniqueRandomPool<string>(true);
			stage.EnemyPoolAct2 = new UniqueRandomPool<string>(true);
			stage.EnemyPoolAct3 = new UniqueRandomPool<string>(true);
			foreach (string elite in elites)
			{
				stage.EnemyPoolAct1.Add(elite, 1f);
				stage.EnemyPoolAct2.Add(elite, 1f);
				stage.EnemyPoolAct3.Add(elite, 1f);
			}
			return stage;
		}
	}
	public sealed class FullEliteJadeboxDef : BaseFullEliteJadeBoxDef
	{
		[EntityLogic(typeof(FullEliteJadeboxDef))]
		public sealed class FullEliteBox : BaseFullElite
		{
			protected override void OnGain(GameRunController gameRun)
			{
				foreach (Stage stage in gameRun.Stages)
				{
					if (((object)stage).GetType() == typeof(BambooForest))
					{
						PoolElites(new List<string> { "Sanyue", "Aya", "Rin" }, stage);
					}
					else if (((object)stage).GetType() == typeof(XuanwuRavine))
					{
						PoolElites(new List<string> { "Nitori", "Youmu", "Kokoro" }, stage);
					}
					else if (((object)stage).GetType() == typeof(WindGodLake))
					{
						PoolElites(new List<string> { "Clownpiece", "Siji", "Doremy" }, stage);
					}
				}
			}

			protected override void OnAdded()
			{
				StartingDraftBoxDef.StartingDraftBox.StaticOnAdded((JadeBox)(object)this);
				PowerBonusBoxDef.PowerBonusBox.StaticOnAdded((JadeBox)(object)this);
			}
		}

		public override IdContainer GetId()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("FullEliteBox");
		}
	}
	public sealed class RainbowFullEliteJadeboxDef : BaseFullEliteJadeBoxDef
	{
		[EntityLogic(typeof(RainbowFullEliteJadeboxDef))]
		public sealed class RainbowFullEliteBox : BaseFullElite
		{
			protected override void OnGain(GameRunController gameRun)
			{
				foreach (Stage stage in gameRun.Stages)
				{
					if (!(((object)stage).GetType() == typeof(BambooForest)) && !(((object)stage).GetType() == typeof(XuanwuRavine)) && !(((object)stage).GetType() == typeof(WindGodLake)))
					{
						continue;
					}
					PoolElites(VanillaElites.eliteGroups, stage);
					stage.EnemyPoolAct2 = stage.EnemyPoolAct1;
					stage.EnemyPoolAct3 = stage.EnemyPoolAct1;
					HashSet<string> ogElites = new HashSet<string>();
					CollectionExtensions.Do<RandomPoolEntry<string>>((IEnumerable<RandomPoolEntry<string>>)stage.EliteEnemyPool, (Action<RandomPoolEntry<string>>)delegate(RandomPoolEntry<string> eg)
					{
						ogElites.Add(eg.Elem);
					});
					stage.EliteEnemyPool = new UniqueRandomPool<string>(true);
					foreach (string eliteGroup in VanillaElites.eliteGroups)
					{
						if (ogElites.Contains(eliteGroup))
						{
							stage.EliteEnemyPool.Add(eliteGroup, 2.1f);
						}
						else
						{
							stage.EliteEnemyPool.Add(eliteGroup, 1f);
						}
					}
				}
			}

			protected override void OnAdded()
			{
				foreach (Stage stage in ((GameEntity)this).GameRun.Stages)
				{
					if (((object)stage).GetType() == typeof(BambooForest) || ((object)stage).GetType() == typeof(XuanwuRavine) || ((object)stage).GetType() == typeof(WindGodLake))
					{
						stage.EnemyPoolAct2 = stage.EnemyPoolAct1;
						stage.EnemyPoolAct3 = stage.EnemyPoolAct1;
					}
				}
				StartingDraftBoxDef.StartingDraftBox.StaticOnAdded((JadeBox)(object)this);
				PowerBonusBoxDef.PowerBonusBox.StaticOnAdded((JadeBox)(object)this);
			}
		}

		public override IdContainer GetId()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("RainbowFullEliteBox");
		}
	}
	public class StartingDraftBoxDef : JadeBoxTemplate
	{
		public class StartingDraftBox : JadeBox
		{
			public static void StaticOnAdded(JadeBox jadeBox)
			{
				jadeBox.HandleGameRunEvent<StationEventArgs>(((GameEntity)jadeBox).GameRun.StationEntered, (GameEventHandler<StationEventArgs>)delegate(StationEventArgs args)
				{
					//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
					//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
					//IL_00db: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e8: Expected O, but got Unknown
					if (!((GameEntity)jadeBox).GameRun.HasJadeBox<DisableStartingBonusesDef.DisableStartingBonuses>())
					{
						Station station = args.Station;
						EntryStation val = (EntryStation)(object)((station is EntryStation) ? station : null);
						if (val != null && CollectionsExtensions.IndexOf<Stage>(((GameEntity)jadeBox).GameRun.Stages, ((Station)val).Stage) == 0)
						{
							List<StationReward> list = new List<StationReward>();
							for (int i = 0; i < jadeBox.Value1; i++)
							{
								list.Add(((GameEntity)jadeBox).GameRun.CurrentStage.GetEnemyCardReward());
							}
							((Station)val).AddRewards((IEnumerable<StationReward>)list);
							((UiPanel<ShowRewardContent>)(object)UiManager.GetPanel<RewardPanel>()).Show(new ShowRewardContent
							{
								Station = ((GameEntity)jadeBox).GameRun.CurrentStation,
								Rewards = ((GameEntity)jadeBox).GameRun.CurrentStation.Rewards,
								ShowNextButton = true
							});
						}
					}
				});
			}
		}

		public override IdContainer GetId()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("StartingDraftBox");
		}

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

		public override JadeBoxConfig MakeConfig()
		{
			JadeBoxConfig val = ((JadeBoxTemplate)this).DefaultConfig();
			val.Value1 = 4;
			return val;
		}
	}
	public class PowerBonusBoxDef : JadeBoxTemplate
	{
		public class PowerBonusBox : JadeBox
		{
			protected override void OnGain(GameRunController gameRun)
			{
				gameRun.GainPower(((JadeBox)this).Value1, false);
			}

			public static void StaticOnAdded(JadeBox jadeBox)
			{
				jadeBox.HandleGameRunEvent<StationEventArgs>(((GameEntity)jadeBox).GameRun.StationEntered, (GameEventHandler<StationEventArgs>)delegate(StationEventArgs args)
				{
					if (!((GameEntity)jadeBox).GameRun.HasJadeBox<DisableStartingBonusesDef.DisableStartingBonuses>())
					{
						Station station = args.Station;
						EntryStation val = (EntryStation)(object)((station is EntryStation) ? station : null);
						if (val != null && CollectionsExtensions.IndexOf<Stage>(((GameEntity)jadeBox).GameRun.Stages, ((Station)val).Stage) == 0)
						{
							((GameEntity)jadeBox).GameRun.GainPower(jadeBox.Value2, false);
						}
					}
				});
			}
		}

		public override IdContainer GetId()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("PowerBonusBox");
		}

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

		public override JadeBoxConfig MakeConfig()
		{
			JadeBoxConfig val = ((JadeBoxTemplate)this).DefaultConfig();
			val.Value1 = 50;
			return val;
		}
	}
	public sealed class BlockToysBonusBoxDef : JadeBoxTemplate
	{
		[EntityLogic(typeof(BlockToysBonusBoxDef))]
		public sealed class BlockToysBonusBox : JadeBox
		{
			protected override void OnGain(GameRunController gameRun)
			{
				((JadeBox)this).OnGain(gameRun);
				((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(GainExhibits(gameRun, new HashSet<Type> { typeof(JimuWanju) }));
			}

			private IEnumerator GainExhibits(GameRunController gameRun, HashSet<Type> exhibits)
			{
				foreach (Type et in exhibits)
				{
					yield return gameRun.GainExhibitRunner(Library.CreateExhibit(et), false, (VisualSourceData)null);
				}
				gameRun.ExhibitPool.RemoveAll((Type e) => exhibits.Contains(e));
			}
		}

		public override IdContainer GetId()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("BlockToysBonusBox");
		}

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

		public override JadeBoxConfig MakeConfig()
		{
			return ((JadeBoxTemplate)this).DefaultConfig();
		}
	}
	public sealed class AllRewardExhibitDef : JadeBoxTemplate
	{
		[EntityLogic(typeof(AllRewardExhibitDef))]
		public sealed class AllRewardExhibit : JadeBox
		{
			protected override void OnAdded()
			{
				((JadeBox)this).HandleGameRunEvent<StationEventArgs>(((GameEntity)this).GameRun.StationRewardGenerating, (GameEventHandler<StationEventArgs>)OnStationRewardGenerating);
			}

			private void OnStationRewardGenerating(StationEventArgs args)
			{
				Station station = args.Station;
				if (station is EnemyStation)
				{
					station.AddReward(StationReward.CreateExhibit(station.Stage.GetEliteEnemyExhibit()));
				}
			}
		}

		public override IdContainer GetId()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("AllRewardExhibit");
		}

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

		public override JadeBoxConfig MakeConfig()
		{
			return ((JadeBoxTemplate)this).DefaultConfig();
		}
	}
	public sealed class DisableStartingBonusesDef : JadeBoxTemplate
	{
		[EntityLogic(typeof(DisableStartingBonusesDef))]
		public sealed class DisableStartingBonuses : JadeBox
		{
		}

		public override IdContainer GetId()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("DisableStartingBonuses");
		}

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

		public override JadeBoxConfig MakeConfig()
		{
			return ((JadeBoxTemplate)this).DefaultConfig();
		}
	}
	public static class PInfo
	{
		public const string GUID = "neo.lbol.runmods.fullElite";

		public const string Name = "Full Elite";

		public const string version = "1.1.60";

		public static readonly Harmony harmony = new Harmony("neo.lbol.runmods.fullElite");
	}
	public static class VanillaElites
	{
		public static HashSet<string> eliteGroups = new HashSet<string> { "Sanyue", "Aya", "Rin", "Nitori", "Youmu", "Kokoro", "Clownpiece", "Siji", "Doremy" };

		public static List<Type> act1 = new List<Type>
		{
			typeof(Aya),
			typeof(Rin),
			typeof(GuihuoBlue),
			typeof(GuihuoRed),
			typeof(GuihuoGreen),
			typeof(Luna),
			typeof(Star),
			typeof(Sunny)
		};

		public static string[] spirits = new string[3] { "GuihuoBlue", "GuihuoRed", "GuihuoGreen" };

		public static List<Type> act2 = new List<Type>
		{
			typeof(Youmu),
			typeof(Nitori),
			typeof(PurifierElite),
			typeof(ScoutElite),
			typeof(TerminatorElite),
			typeof(Kokoro),
			typeof(Maoyu),
			typeof(MaskRed),
			typeof(MaskBlue),
			typeof(MaskGreen)
		};

		public static string[] drones = new string[3] { "PurifierElite", "ScoutElite", "TerminatorElite" };

		public static string[] masks = new string[3] { "MaskRed", "MaskBlue", "MaskGreen" };

		public static List<Type> act3 = new List<Type>
		{
			typeof(Siji),
			typeof(Alice),
			typeof(Cirno),
			typeof(Koishi),
			typeof(Marisa),
			typeof(Reimu),
			typeof(Sakuya),
			typeof(Doremy),
			typeof(DreamAya),
			typeof(DreamJunko),
			typeof(DreamRemilia),
			typeof(DreamYoumu),
			typeof(Clownpiece),
			typeof(BlackFairy),
			typeof(WhiteFairy),
			typeof(YinyangyuBlueReimu),
			typeof(YinyangyuRedReimu)
		};

		public static string[] dreamGirls = new string[4] { "DreamAya", "DreamJunko", "DreamRemilia", "DreamYoumu" };

		public static string[] eikiSummons = new string[6] { "Alice", "Cirno", "Koishi", "Marisa", "Reimu", "Sakuya" };
	}
	internal class WatermarkWrapper
	{
		[MethodImpl(MethodImplOptions.NoInlining)]
		internal static void ActivateWatermark()
		{
			API.ActivateWatermark();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}