Decompiled source of FullElite v1.1.1

FullElite.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AddWatermark;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using DG.Tweening;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
using FullElite.BattleModifiers;
using FullElite.BattleModifiers.Actions;
using FullElite.BattleModifiers.Args;
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.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.Entities;
using LBoLEntitySideloader.Resource;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("LBoL.Base")]
[assembly: IgnoresAccessChecksTo("LBoL.ConfigData")]
[assembly: IgnoresAccessChecksTo("LBoL.Core")]
[assembly: IgnoresAccessChecksTo("LBoL.EntityLib")]
[assembly: IgnoresAccessChecksTo("LBoL.Presentation")]
[assembly: IgnoresAccessChecksTo("Untitled.ConfigDataBuilder.Base")]
[assembly: AssemblyCompany("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.1")]
	[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", "");

		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();
			}
			EliteModifiers.Innitialize();
		}

		private void OnDestroy()
		{
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}
	}
	public class EliteModifiers
	{
		public static void Innitialize()
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//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)
			ModPrecond item = (Unit unit) => VanillaElites.eliteGroups.Contains(unit.Battle.EnemyGroup.Id);
			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, ModMod>> func3 = (Type se) => (int level) => ModFactory.AddSE(se, level);
			ModPrecond item2 = PrecondFactory.HasJadeboxes(new HashSet<string> { IdContainer.op_Implicit(((EntityDefinition)new RainbowFullEliteJadeboxDef()).UniqueId) });
			Func<Vector3, ModMod> func4 = (Vector3 targetPos) => 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 obj = uv;
				if (obj != null)
				{
					TweenSettingsExtensions.OnComplete<TweenerCore<Vector3, Vector3, VectorOptions>>(TweenSettingsExtensions.SetEase<TweenerCore<Vector3, Vector3, VectorOptions>>(ShortcutExtensions.DOLocalMove(((Component)obj).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 unitModifier = new UnitModifier(item3);
				unitModifier.preconds.Add(item);
				unitModifier.preconds.Add(item2);
				unitModifier.preconds.Add(PrecondFactory.IsStage(typeof(XuanwuRavine)));
				if (!VanillaElites.spirits.Contains(item3))
				{
					unitModifier.mods.Add(ModFactory.AddSE(typeof(Firepower), 3));
					unitModifier.mods.Add(ModFactory.LazyArg(func2(1.7f, 1.9f), ModFactory.MulEffetiveHp));
				}
				else
				{
					unitModifier.mods.Add(ModFactory.LazyArg(func(1, 2), func3(typeof(Firepower))));
					if (item3 == "GuihuoRed")
					{
						unitModifier.mods.Add(ModFactory.DoSomeAction(delegate(Unit unit)
						{
							GuihuoRed val6 = (GuihuoRed)(object)((unit is GuihuoRed) ? unit : null);
							if (val6 != null)
							{
								((Guihuo)val6).NoDebuffMove = false;
							}
							return unit;
						}));
					}
				}
				if (item3 != "Sunny" && item3 != "Luna" && item3 != "Star")
				{
					unitModifier.mods.Add(ModFactory.LazyArg(() => Random.Range(1.2f, 1.4f), ModFactory.ScaleModel));
				}
				if (item3 == "Aya")
				{
					unitModifier.mods.Add(ModFactory.AddSE<FastAttack>((int?)5, (int?)null, (int?)null, (int?)null, 0f, startAutoDecreasing: true));
					unitModifier.mods.Add(ModFactory.MultiplyHp(1.15f));
				}
				UnitModifier unitModifier2 = new UnitModifier(item3);
				unitModifier2.preconds.Add(item);
				unitModifier2.preconds.Add(item2);
				unitModifier2.preconds.Add(PrecondFactory.IsStage(typeof(WindGodLake)));
				if (item3 == "Sunny")
				{
					unitModifier2.mods.Add(func4(new Vector3(-3f, 0f)));
				}
				if (item3 == "Luna")
				{
					unitModifier2.mods.Add(func4(new Vector3(-2.7f, -1.7f)));
				}
				if (item3 == "Star")
				{
					unitModifier2.mods.Add(func4(new Vector3(0f, 1.45f)));
				}
				if (!VanillaElites.spirits.Contains(item3))
				{
					if (item3 != "Sunny" && item3 != "Luna" && item3 != "Star")
					{
						unitModifier2.mods.Add(ModFactory.AddSE(typeof(Firepower), 5));
					}
					else
					{
						unitModifier2.mods.Add(ModFactory.LazyArg(func(5, 7), func3(typeof(Firepower))));
						unitModifier2.mods.Add(ModFactory.DoSomeAction(delegate(Unit unit)
						{
							LightFairy val5 = (LightFairy)(object)((unit is LightFairy) ? unit : null);
							if (val5 != null)
							{
								val5.Next = (MoveType)2;
							}
							return unit;
						}));
					}
					unitModifier2.mods.Add(ModFactory.LazyArg(func2(2.1f, 2.3f), ModFactory.MulEffetiveHp));
				}
				else
				{
					unitModifier2.mods.Add(ModFactory.LazyArg(func2(1.05f, 1.2f), ModFactory.MulEffetiveHp));
					unitModifier2.mods.Add(ModFactory.LazyArg(func(2, 5), func3(typeof(Firepower))));
					if (item3 == "GuihuoRed")
					{
						unitModifier2.mods.Add(ModFactory.DoSomeAction(delegate(Unit unit)
						{
							GuihuoRed val4 = (GuihuoRed)(object)((unit is GuihuoRed) ? unit : null);
							if (val4 != null)
							{
								((Guihuo)val4).NoDebuffMove = false;
								((Guihuo)val4).Next = (MoveType)1;
							}
							return unit;
						}));
					}
				}
				if (item3 != "Sunny" && item3 != "Luna" && item3 != "Star")
				{
					unitModifier2.mods.Add(ModFactory.LazyArg(() => Random.Range(1.5f, 1.85f), ModFactory.ScaleModel));
				}
				if (item3 == "Aya")
				{
					unitModifier2.mods.Add(ModFactory.LazyArg(func(7, 11), func3(typeof(FastAttack))));
					unitModifier2.mods.Add(ModFactory.LazyArg(func(1, 2), func3(typeof(WindGirl))));
					unitModifier2.mods.Add(ModFactory.MultiplyHp(1.2f));
					unitModifier2.mods.Add(ModFactory.ScaleModel(0.3f));
				}
				if (item3 == "Rin")
				{
					unitModifier2.mods.Add(ModFactory.DoSomeAction(delegate(Unit unit)
					{
						((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)(object)new ModifyBlockShield(unit, 35, 0)));
						return unit;
					}));
				}
			}
			foreach (string item4 in VanillaElites.act2.Select((Type t) => t.Name))
			{
				UnitModifier unitModifier3 = new UnitModifier(item4);
				unitModifier3.preconds.Add(item);
				unitModifier3.preconds.Add(item2);
				unitModifier3.preconds.Add(PrecondFactory.IsStage(typeof(BambooForest)));
				if (item4 == "Nitori")
				{
					unitModifier3.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), 4));
					unitModifier3.mods.Add(ModFactory.LazyArg(func2(0.45f, 0.5f), ModFactory.MulEffetiveHp));
				}
				else
				{
					if (item4 != "Youmu")
					{
						unitModifier3.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), 3));
					}
					unitModifier3.mods.Add(ModFactory.LazyArg(func2(0.48f, 0.55f), ModFactory.MulEffetiveHp));
				}
				if (item4 == "Youmu")
				{
					unitModifier3.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), 4));
				}
				unitModifier3.mods.Add(ModFactory.LazyArg(() => Random.Range(0.85f, 0.95f), ModFactory.ScaleModel));
				if (item4 == "TerminatorElite")
				{
					unitModifier3.mods.Add(ModFactory.DoSomeAction(delegate(Unit unit)
					{
						//IL_001d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0027: Expected O, but got Unknown
						TerminatorElite val2 = (TerminatorElite)(object)((unit is TerminatorElite) ? unit : null);
						DroneBlock val3 = default(DroneBlock);
						if (((Unit)val2).TryGetStatusEffect<DroneBlock>(ref val3))
						{
							((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)val3, true, 0.1f)));
							((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)(object)new ModifyBlockShield(unit, 0, 0, 0f)));
							((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)(object)new ApplySEnoTriggers(typeof(DroneBlock), unit, 10)));
						}
						return unit;
					}));
				}
				UnitModifier unitModifier4 = new UnitModifier(item4);
				unitModifier4.preconds.Add(item);
				unitModifier4.preconds.Add(item2);
				unitModifier4.preconds.Add(PrecondFactory.IsStage(typeof(WindGodLake)));
				if (item4 == "Youmu")
				{
					unitModifier4.mods.Add(ModFactory.AddSE(typeof(LouguanJianSe), 1));
				}
				else
				{
					unitModifier4.mods.Add(ModFactory.AddSE(typeof(Firepower), 3));
				}
				if (VanillaElites.masks.Contains(item4))
				{
					unitModifier4.mods.Add(ModFactory.LazyArg(func2(1.4f, 1.7f), ModFactory.MulEffetiveHp));
					continue;
				}
				unitModifier4.mods.Add(ModFactory.LazyArg(func2(1.7f, 1.9f), ModFactory.MulEffetiveHp));
				unitModifier4.mods.Add(ModFactory.LazyArg(() => Random.Range(1.5f, 1.85f), ModFactory.ScaleModel));
			}
			ModMod action = delegate(Unit unit)
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: 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? level2 = unit.Shield;
					int? count = 3;
					((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)(object)new ApplySEnoTriggers(typeFromHandle, unit, level2, null, count)));
				}
				return unit;
			};
			foreach (string item5 in VanillaElites.act3.Select((Type t) => t.Name))
			{
				UnitModifier unitModifier5 = new UnitModifier(item5);
				unitModifier5.preconds.Add(item);
				unitModifier5.preconds.Add(item2);
				unitModifier5.preconds.Add(PrecondFactory.IsStage(typeof(BambooForest)));
				unitModifier5.mods.Add(ModFactory.LazyArg(func2(0.28f, 0.33f), ModFactory.MulEffetiveHp));
				if (VanillaElites.eikiSummons.Contains(item5))
				{
					unitModifier5.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), 4));
				}
				else if (item5 == "Doremy")
				{
					unitModifier5.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), 7));
					unitModifier5.mods.Add(ModFactory.DoSomeAction(action));
					unitModifier5.mods.Add(ModFactory.MultiplyHp(0.95f));
				}
				else
				{
					unitModifier5.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), 5));
				}
				if (item5 == "Clownpiece")
				{
					unitModifier5.mods.Add(ModFactory.MultiplyHp(1.15f));
				}
				if (item5 == "Doremy")
				{
					unitModifier5.mods.Add(ModFactory.ScaleModel(0.7f));
				}
				else
				{
					unitModifier5.mods.Add(ModFactory.LazyArg(() => Random.Range(0.55f, 0.65f), ModFactory.ScaleModel));
				}
				UnitModifier unitModifier6 = new UnitModifier(item5);
				unitModifier6.preconds.Add(item);
				unitModifier6.preconds.Add(item2);
				unitModifier6.preconds.Add(PrecondFactory.IsStage(typeof(XuanwuRavine)));
				unitModifier6.mods.Add(ModFactory.LazyArg(func2(0.48f, 0.55f), ModFactory.MulEffetiveHp));
				if (VanillaElites.dreamGirls.Contains(item5))
				{
					unitModifier6.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), 2));
				}
				else if (item5 == "Doremy")
				{
					unitModifier6.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), 5));
					unitModifier6.mods.Add(ModFactory.DoSomeAction(action));
				}
				else
				{
					unitModifier6.mods.Add(ModFactory.AddSE(typeof(FirepowerNegative), 3));
				}
				if (item5 == "Clownpiece")
				{
					unitModifier6.mods.Add(ModFactory.MultiplyHp(1.27f));
				}
				if (item5 == "Doremy")
				{
					unitModifier5.mods.Add(ModFactory.ScaleModel(0.95f));
					continue;
				}
				unitModifier6.mods.Add(ModFactory.LazyArg(() => Random.Range(0.88f, 0.95f), ModFactory.ScaleModel));
			}
		}
	}
	public abstract class BaseFullEliteJadeBoxDef : JadeBoxTemplate
	{
		public const string JdBoxGroup = "FullElite";

		public override LocalizationOption LoadLocalization()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			return (LocalizationOption)new GlobalLocalization(BepinexPlugin.embeddedSource);
		}

		public override JadeBoxConfig MakeConfig()
		{
			JadeBoxConfig val = ((JadeBoxTemplate)this).DefaultConfig();
			val.Group = new List<string> { "FullElite" };
			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);
					}
				}
			}
		}

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

		public override LocalizationOption LoadLocalization()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GlobalLocalization val = new GlobalLocalization(BepinexPlugin.embeddedSource);
			val.LocalizationFiles.AddLocaleFile((Locale)0, "JadeboxesEn");
			return (LocalizationOption)(object)val;
		}
	}
	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;
					}
				}
			}
		}

		public override IdContainer GetId()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return IdContainer.op_Implicit("RainbowFullEliteBox");
		}
	}
	public sealed class StartingDraftBoxDef : JadeBoxTemplate
	{
		[EntityLogic(typeof(StartingDraftBoxDef))]
		public sealed class StartingDraftBox : JadeBox
		{
			protected override void OnAdded()
			{
				((JadeBox)this).HandleGameRunEvent<StationEventArgs>(((GameEntity)this).GameRun.StationEntered, (GameEventHandler<StationEventArgs>)delegate(StationEventArgs args)
				{
					//IL_0077: Unknown result type (might be due to invalid IL or missing references)
					//IL_007c: Unknown result type (might be due to invalid IL or missing references)
					//IL_008e: 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_00b2: 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)
					{
						List<StationReward> list = new List<StationReward>();
						for (int i = 0; i < ((JadeBox)this).Value1; i++)
						{
							list.Add(((GameEntity)this).GameRun.CurrentStage.GetEnemyCardReward());
						}
						((Station)val).AddRewards((IEnumerable<StationReward>)list);
						((UiPanel<ShowRewardContent>)(object)UiManager.GetPanel<RewardPanel>()).Show(new ShowRewardContent
						{
							Station = ((GameEntity)this).GameRun.CurrentStation,
							Rewards = ((GameEntity)this).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()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			return (LocalizationOption)new GlobalLocalization(BepinexPlugin.embeddedSource);
		}

		public override JadeBoxConfig MakeConfig()
		{
			JadeBoxConfig val = ((JadeBoxTemplate)this).DefaultConfig();
			val.Value1 = 4;
			return val;
		}
	}
	public sealed class PowerBonusBoxDef : JadeBoxTemplate
	{
		[EntityLogic(typeof(PowerBonusBoxDef))]
		public sealed class PowerBonusBox : JadeBox
		{
			protected override void OnGain(GameRunController gameRun)
			{
				gameRun.GainPower(((JadeBox)this).Value1, 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()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			return (LocalizationOption)new GlobalLocalization(BepinexPlugin.embeddedSource);
		}

		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()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			return (LocalizationOption)new GlobalLocalization(BepinexPlugin.embeddedSource);
		}

		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.1";

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

		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 FullElite.BattleModifiers
{
	public delegate bool ModPrecond(Unit unit);
	public delegate Unit ModMod(Unit unit);
	[HarmonyPatch]
	internal class ApplyEnemyMods_Patch
	{
		[HarmonyPatch(typeof(Unit), "EnterBattle")]
		[HarmonyPostfix]
		private static void EnterBattle_Postfix(Unit __instance)
		{
			__instance.HandleBattleEvent<GameEventArgs>(__instance.Battle.BattleStarted, (GameEventHandler<GameEventArgs>)delegate
			{
				UnitModTracker.Instance.Perform(__instance);
			}, (GameEventPriority)999);
		}

		[HarmonyPatch(typeof(BattleController), "Spawn", new Type[]
		{
			typeof(EnemyUnit),
			typeof(EnemyUnit),
			typeof(int),
			typeof(bool)
		})]
		[HarmonyPostfix]
		private static void Spawn_Postfix(EnemyUnit __result)
		{
			UnitModTracker.Instance.Perform((Unit)(object)__result);
		}
	}
	[HarmonyPatch(typeof(GameDirector), "EnterBattle")]
	internal class GameDirectorEnterBattle_Patch
	{
		private static void Postfix(GameDirector __instance, BattleController battle)
		{
			battle.ActionViewer.Register<ApplySEnoTriggers>((BattleActionViewer<ApplySEnoTriggers>)__instance.ApplyStatusEffectViewer, (Predicate<ApplySEnoTriggers>)null);
			battle.ActionViewer.Register<ModifyBlockShield>((BattleActionViewer<ModifyBlockShield>)GameDirector.LoseBlockShieldViewer, (Predicate<ModifyBlockShield>)null);
		}
	}
	[HarmonyPatch(typeof(GameDirector), "LeaveBattle")]
	internal class GameDirectorLeaveBattle_Patch
	{
		private static void Postfix(GameDirector __instance, BattleController battle)
		{
			battle.ActionViewer.Unregister<ApplySEnoTriggers>((BattleActionViewer<ApplySEnoTriggers>)__instance.ApplyStatusEffectViewer);
			battle.ActionViewer.Unregister<ModifyBlockShield>((BattleActionViewer<ModifyBlockShield>)GameDirector.LoseBlockShieldViewer);
		}
	}
	public class ModFactory
	{
		public static ModMod LazyArg<T>(Func<T> getArg, Func<T, ModMod> target)
		{
			return delegate(Unit unit)
			{
				T arg = getArg();
				return target(arg)(unit);
			};
		}

		public static ModMod AddSE<T>(int? level = null, int? duration = null, int? count = null, int? limit = null, float occupationTime = 0f, bool startAutoDecreasing = true) where T : StatusEffect
		{
			return AddSE(typeof(T), level, duration, count, limit, occupationTime, startAutoDecreasing);
		}

		public static ModMod AddSE(Type se, int? level = null, int? duration = null, int? count = null, int? limit = null, float occupationTime = 0f, bool startAutoDecreasing = true)
		{
			return delegate(Unit unit)
			{
				((GameEntity)unit).React((IEnumerable<BattleAction>)(object)new BattleAction[1] { (BattleAction)new ApplySEnoTriggers(se, unit, level, duration, count, limit, occupationTime, startAutoDecreasing) });
				return unit;
			};
		}

		public static ModMod MulEffetiveHp(float multiplier)
		{
			return MultiplyHp(multiplier, multiplyBlock: true);
		}

		public static ModMod MultiplyHp(float multiplier, bool multiplyBlock = false)
		{
			return delegate(Unit unit)
			{
				int num = ModifyBlockShield.ApplyMul(unit.MaxHp, multiplier, 1);
				unit.SetMaxHp(num, num);
				if (multiplyBlock)
				{
					((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)(object)new ModifyBlockShield(unit, 0, 0, multiplier)));
				}
				IUnitView view = unit.View;
				UnitView val = (UnitView)(object)((view is UnitView) ? view : null);
				if ((Object)(object)val != (Object)null)
				{
					val._statusWidget.SetHpBar();
					if (unit is PlayerUnit)
					{
						UiManager.GetPanel<SystemBoard>().OnMaxHpChanged();
						val.OnMaxHpChanged();
					}
				}
				return unit;
			};
		}

		public static ModMod ScaleModel(float multiplier)
		{
			return delegate(Unit unit)
			{
				//IL_0025: 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)
				IUnitView view = unit.View;
				UnitView val = (UnitView)(object)((view is UnitView) ? view : null);
				if ((Object)(object)val != (Object)null)
				{
					((Component)val).transform.localScale = ((Component)val).transform.localScale * multiplier;
				}
				return unit;
			};
		}

		public static ModMod StageCheck(Type stageType, ModMod mod)
		{
			return (Unit unit) => PrecondFactory.IsStage(stageType)(unit) ? unit : mod(unit);
		}

		public static ModMod DoSomeAction(ModMod action)
		{
			return delegate(Unit unit)
			{
				((GameEntity)unit).React(Reactor.op_Implicit((BattleAction)(object)new ArbitraryBattleAction(unit, action)));
				return unit;
			};
		}
	}
	public static class PrecondFactory
	{
		public static ModPrecond HasJadeboxes(HashSet<string> jadeBoxes)
		{
			return (Unit unit) => ((GameEntity)unit).GameRun.JadeBoxes.Select((JadeBox jb) => ((object)jb).GetType().Name).Count((string name) => jadeBoxes.Contains(name)) >= jadeBoxes.Count;
		}

		public static ModPrecond IsEnemyGroup(string groupId)
		{
			return delegate
			{
				int result;
				if (groupId != null)
				{
					GameMaster instance = Singleton<GameMaster>.Instance;
					object obj;
					if (instance == null)
					{
						obj = null;
					}
					else
					{
						GameRunController currentGameRun = instance.CurrentGameRun;
						if (currentGameRun == null)
						{
							obj = null;
						}
						else
						{
							BattleController battle = currentGameRun.Battle;
							if (battle == null)
							{
								obj = null;
							}
							else
							{
								EnemyGroup enemyGroup = battle.EnemyGroup;
								obj = ((enemyGroup != null) ? enemyGroup.Id : null);
							}
						}
					}
					result = (((string?)obj == groupId) ? 1 : 0);
				}
				else
				{
					result = 0;
				}
				return (byte)result != 0;
			};
		}

		public static ModPrecond IsStage(Type stageType)
		{
			return delegate
			{
				int result;
				if (stageType != null)
				{
					GameMaster instance = Singleton<GameMaster>.Instance;
					object obj;
					if (instance == null)
					{
						obj = null;
					}
					else
					{
						GameRunController currentGameRun = instance.CurrentGameRun;
						obj = ((currentGameRun == null) ? null : ((object)currentGameRun.CurrentStage)?.GetType());
					}
					result = (((Type?)obj == stageType) ? 1 : 0);
				}
				else
				{
					result = 0;
				}
				return (byte)result != 0;
			};
		}
	}
	public class UnitModifier
	{
		public string unitId;

		public bool modifyPlayer = false;

		public HashSet<ModPrecond> preconds = new HashSet<ModPrecond>();

		public List<ModMod> mods = new List<ModMod>();

		public UnitModifier(string groupId, bool modifyPlayer = false)
		{
			unitId = groupId;
			UnitModTracker.Instance.AddModifier(this);
			this.modifyPlayer = modifyPlayer;
		}

		public void ApplyMods(Unit unit)
		{
			if ((unit is PlayerUnit && !modifyPlayer) || (preconds.Count > 0 && preconds.Select((ModPrecond p) => p(unit)).Any((bool b) => !b)))
			{
				return;
			}
			foreach (ModMod mod in mods)
			{
				try
				{
					mod(unit);
				}
				catch (Exception ex)
				{
					BepinexPlugin.log.LogError((object)ex);
				}
			}
		}
	}
	public class UnitModTracker
	{
		private static UnitModTracker _instance;

		private Dictionary<string, HashSet<UnitModifier>> modDic = new Dictionary<string, HashSet<UnitModifier>>();

		public static UnitModTracker Instance
		{
			get
			{
				if (_instance == null)
				{
					_instance = new UnitModTracker();
				}
				return _instance;
			}
		}

		public void AddModifier(UnitModifier modifier)
		{
			modDic.TryAdd(modifier.unitId, new HashSet<UnitModifier>());
			modDic[modifier.unitId].Add(modifier);
		}

		public void Perform(Unit unit)
		{
			if (modDic.TryGetValue(((GameEntity)unit).Id, out var value))
			{
				CollectionExtensions.Do<UnitModifier>((IEnumerable<UnitModifier>)value, (Action<UnitModifier>)delegate(UnitModifier m)
				{
					m.ApplyMods(unit);
				});
			}
		}
	}
}
namespace FullElite.BattleModifiers.Args
{
	public class ArbitraryBattleEventArgs : GameEventArgs
	{
		public Unit Target { get; set; }

		public ModMod unitAction { get; set; }

		public override string GetBaseDebugString()
		{
			return "ArbitraryAction: " + GameEventArgs.DebugString((GameEntity)(object)Target);
		}
	}
}
namespace FullElite.BattleModifiers.Actions
{
	public class ApplySEnoTriggers : ApplyStatusEffectAction
	{
		public ApplySEnoTriggers(Type type, Unit target, int? level = null, int? duration = null, int? count = null, int? limit = null, float occupationTime = 0f, bool startAutoDecreasing = true)
			: base(type, target, level, duration, count, limit, occupationTime, startAutoDecreasing)
		{
		}

		public override void PreEventPhase()
		{
		}

		public override void PostEventPhase()
		{
		}
	}
	public class ArbitraryBattleAction : SimpleEventBattleAction<ArbitraryBattleEventArgs>
	{
		public ArbitraryBattleAction(Unit unit, ModMod unitAction)
		{
			((EventBattleAction<ArbitraryBattleEventArgs>)(object)this).Args = new ArbitraryBattleEventArgs();
			((EventBattleAction<ArbitraryBattleEventArgs>)(object)this).Args.Target = unit;
			((EventBattleAction<ArbitraryBattleEventArgs>)(object)this).Args.unitAction = unitAction;
		}

		public override void MainPhase()
		{
			try
			{
				((EventBattleAction<ArbitraryBattleEventArgs>)(object)this).Args.unitAction(((EventBattleAction<ArbitraryBattleEventArgs>)(object)this).Args.Target);
			}
			catch (Exception arg)
			{
				BepinexPlugin.log.LogError((object)$"Exception during {((object)this).GetType().Name}: {arg}");
			}
		}
	}
	public class ModifyBlockShield : LoseBlockShieldAction
	{
		private float multiplier;

		public ModifyBlockShield(Unit target, int block, int shield, float multiplier = 1f, bool forced = true)
			: base(target, block, shield, forced)
		{
			this.multiplier = multiplier;
			BlockShieldEventArgs args = ((EventBattleAction<BlockShieldEventArgs>)this).Args;
			args.Block *= -1f;
			BlockShieldEventArgs args2 = ((EventBattleAction<BlockShieldEventArgs>)this).Args;
			args2.Shield *= -1f;
		}

		public static int ApplyMul(int val, float mul, int min)
		{
			return (int)Math.Max((float)val * mul, min);
		}

		public override void PreEventPhase()
		{
			Unit target = ((EventBattleAction<BlockShieldEventArgs>)this).Args.Target;
			BlockShieldEventArgs args = ((EventBattleAction<BlockShieldEventArgs>)this).Args;
			args.Block += (float)(target.Block - ApplyMul(target.Block, multiplier, 0));
			BlockShieldEventArgs args2 = ((EventBattleAction<BlockShieldEventArgs>)this).Args;
			args2.Shield += (float)(target.Shield - ApplyMul(target.Shield, multiplier, 0));
		}

		public override void PostEventPhase()
		{
		}

		public override string ExportDebugDetails()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Invalid comparison between Unknown and I4
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			if ((int)((EventBattleAction<BlockShieldEventArgs>)this).Args.Type > 0)
			{
				return string.Format("{0} --- {{B: {1}, S: {2}, mul: {3}, Type: {5}}} --> {6}", GameEventArgs.DebugString((GameEntity)(object)((EventBattleAction<BlockShieldEventArgs>)this).Args.Source), 0f - ((EventBattleAction<BlockShieldEventArgs>)this).Args.Block, 0f - ((EventBattleAction<BlockShieldEventArgs>)this).Args.Shield, ((EventBattleAction<BlockShieldEventArgs>)this).Args.Type, multiplier, GameEventArgs.DebugString((GameEntity)(object)((EventBattleAction<BlockShieldEventArgs>)this).Args.Target));
			}
			return $"{GameEventArgs.DebugString((GameEntity)(object)((EventBattleAction<BlockShieldEventArgs>)this).Args.Source)} --- {{B: {0f - ((EventBattleAction<BlockShieldEventArgs>)this).Args.Block}, S: {0f - ((EventBattleAction<BlockShieldEventArgs>)this).Args.Shield}, mul: {multiplier}}} --> {GameEventArgs.DebugString((GameEntity)(object)((EventBattleAction<BlockShieldEventArgs>)this).Args.Target)}";
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}