Decompiled source of CrampsMayumiMod v0.7.0

LBoLMod.dll

Decompiled 2 days ago
using System;
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 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.Helpers;
using LBoL.Core.Intentions;
using LBoL.Core.StatusEffects;
using LBoL.Core.Units;
using LBoL.EntityLib.Cards;
using LBoL.EntityLib.Cards.Character.Sakuya;
using LBoL.EntityLib.Cards.Neutral.NoColor;
using LBoL.EntityLib.Exhibits;
using LBoL.EntityLib.Exhibits.Shining;
using LBoL.EntityLib.StatusEffects.Basic;
using LBoL.EntityLib.StatusEffects.Cirno;
using LBoL.EntityLib.StatusEffects.Others;
using LBoL.Presentation.UI.Panels;
using LBoL.Presentation.UI.Widgets;
using LBoLEntitySideloader;
using LBoLEntitySideloader.Attributes;
using LBoLEntitySideloader.Entities;
using LBoLEntitySideloader.Resource;
using LBoLEntitySideloader.Utils;
using LBoLMod.BattleActions;
using LBoLMod.Cards;
using LBoLMod.Exhibits;
using LBoLMod.GameEvents;
using LBoLMod.PlayerUnits;
using LBoLMod.StatusEffects;
using LBoLMod.StatusEffects.Abilities;
using LBoLMod.StatusEffects.Assign;
using LBoLMod.StatusEffects.Debuffs;
using LBoLMod.StatusEffects.Localization;
using LBoLMod.UltimateSkills;
using LBoLMod.Utils;
using TMPro;
using UnityEngine;
using UnityEngine.Experimental.Rendering;

[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("LBoLMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+eb4b8c0af1a235866191797645227186366942ca")]
[assembly: AssemblyProduct("LBoLMod")]
[assembly: AssemblyTitle("LBoLMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace LBoLMod
{
	[BepInPlugin("cramps-firstmod", "Mayumi Mod", "0.7.0")]
	[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("cramps-firstmod", "");

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

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

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

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

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

		internal static BatchLocalization ultimateSkillBatchLoc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(UltimateSkillTemplate), "ultimateSkill", (Locale)0, 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();
			}
		}

		private void OnDestroy()
		{
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}
	}
	public static class PInfo
	{
		public const string GUID = "cramps-firstmod";

		public const string Name = "Mayumi Mod";

		public const string version = "0.7.0";

		public static readonly Harmony harmony = new Harmony("cramps-firstmod");
	}
	internal class WatermarkWrapper
	{
		[MethodImpl(MethodImplOptions.NoInlining)]
		internal static void ActivateWatermark()
		{
			API.ActivateWatermark();
		}
	}
}
namespace LBoLMod.Utils
{
	public enum HaniwaActionType
	{
		Require,
		Sacrifice,
		Assign
	}
	public static class HaniwaAssignUtils
	{
		public static readonly List<Type> OnColorAssignCardTypes = new List<Type>
		{
			typeof(ArcherPrepVolley),
			typeof(CavalrySupplies),
			typeof(FencerBuildBarricade),
			typeof(BuildWatchtower),
			typeof(CavalryRush),
			typeof(CavalryScout),
			typeof(ChargeAttack),
			typeof(ArcherPrepDebuff),
			typeof(FencerPrepCounter)
		};

		public static List<Type> GetAssignCardTypes(PlayerUnit player, bool checkOffColor = true)
		{
			//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)
			if (checkOffColor)
			{
				ManaGroup baseMana = ((GameEntity)player).GameRun.BaseMana;
				bool flag = ((ManaGroup)(ref baseMana)).HasColor((ManaColor)2);
				bool flag2 = player.HasExhibit<KongbaiKapai>();
				if (flag || flag2)
				{
					return CollectionExtensions.AddItem<Type>((IEnumerable<Type>)OnColorAssignCardTypes, typeof(ArcherPrepFrostArrow)).ToList();
				}
			}
			return OnColorAssignCardTypes;
		}

		public static List<ModAssignOptionCard> CreateAssignOptionCards(PlayerUnit player, bool includePermanent = true)
		{
			List<ModAssignOptionCard> list = new List<ModAssignOptionCard>();
			foreach (ModAssignStatusEffect item in ((Unit)player).StatusEffects.Where((StatusEffect s) => s is ModAssignStatusEffect))
			{
				ModAssignOptionCard modAssignOptionCard = Library.CreateCard<ModAssignOptionCard>();
				modAssignOptionCard.CardName = ((GameEntity)item).Name;
				modAssignOptionCard.CardText = ((GameEntity)item).Description;
				modAssignOptionCard.StatusEffect = item;
				if (modAssignOptionCard.StatusEffect is AssignArcherPrepFrostArrow)
				{
					CardConfig val = ObjectExtensions.Copy<CardConfig>(((Card)modAssignOptionCard).Config);
					val.Colors = new List<ManaColor> { (ManaColor)2 };
					((Card)modAssignOptionCard).Config = val;
				}
				bool flag = true;
				if (!includePermanent && item.IsPermanent)
				{
					flag = false;
				}
				if (flag)
				{
					list.Add(modAssignOptionCard);
				}
			}
			return list;
		}

		public static IEnumerable<BattleAction> GetRandomAssignBuffs(BattleController battle, int fencerCount = 0, int archerCount = 0, int cavalryCount = 0, bool manualStack = true)
		{
			Dictionary<string, int> haniwaCount = new Dictionary<string, int>
			{
				{ "fencer", fencerCount },
				{ "archer", archerCount },
				{ "cavalry", cavalryCount }
			};
			bool continueRandomizing = true;
			ModAssignStatusEffect mase = default(ModAssignStatusEffect);
			while (continueRandomizing)
			{
				List<ModAssignCard> allOptions = ((IEnumerable<Type>)GetAssignCardTypes(battle.Player)).Select((Func<Type, Card>)Library.CreateCard).Cast<ModAssignCard>().ToList();
				while (true)
				{
					ModAssignCard randomSelection = CollectionsExtensions.SampleOrDefault<ModAssignCard>((IEnumerable<ModAssignCard>)allOptions, battle.GameRun.BattleRng);
					if (randomSelection == null)
					{
						continueRandomizing = false;
						break;
					}
					allOptions.Remove(randomSelection);
					if (randomSelection.FencerAssigned > haniwaCount["fencer"] || randomSelection.ArcherAssigned > haniwaCount["archer"] || randomSelection.CavalryAssigned > haniwaCount["cavalry"])
					{
						continue;
					}
					((Card)randomSelection).SetBattle(battle);
					randomSelection.ManualStack = manualStack;
					BattleAction assignBuffAction = ((Card)randomSelection).BuffAction(randomSelection.AssignStatusType, randomSelection.StartingTaskLevel, 0, 0, randomSelection.StartingCardCounter, 0.2f);
					yield return assignBuffAction;
					ApplyStatusEffectAction sea = (ApplyStatusEffectAction)(object)((assignBuffAction is ApplyStatusEffectAction) ? assignBuffAction : null);
					int num;
					if (sea != null)
					{
						StatusEffect effect = ((EventBattleAction<StatusEffectApplyEventArgs>)(object)sea).Args.Effect;
						mase = effect as ModAssignStatusEffect;
						num = ((mase != null) ? 1 : 0);
					}
					else
					{
						num = 0;
					}
					if (num != 0)
					{
						mase.JustApplied = false;
					}
					haniwaCount["fencer"] -= randomSelection.FencerAssigned;
					haniwaCount["archer"] -= randomSelection.ArcherAssigned;
					haniwaCount["cavalry"] -= randomSelection.CavalryAssigned;
					break;
				}
			}
		}
	}
	public static class HaniwaFrontlineUtils
	{
		public static readonly List<Type> CommonOptionTypes = new List<Type>
		{
			typeof(OptionHaniwaAttacker),
			typeof(OptionHaniwaBodyguard),
			typeof(OptionHaniwaSharpshooter),
			typeof(OptionHaniwaSupport)
		};

		public static readonly List<Type> CommonSummonTypes = new List<Type>
		{
			typeof(HaniwaAttacker),
			typeof(HaniwaBodyguard),
			typeof(HaniwaSharpshooter),
			typeof(HaniwaSupport)
		};

		public static readonly List<Type> UncommonOptionTypes = new List<Type>
		{
			typeof(OptionHaniwaUpgrader),
			typeof(OptionHaniwaExploiter),
			typeof(OptionHaniwaSpy),
			typeof(OptionHaniwaMonk),
			typeof(OptionHaniwaCharger),
			typeof(OptionHaniwaSentinel)
		};

		public static readonly List<Type> UncommonSummonTypes = new List<Type>
		{
			typeof(HaniwaUpgrader),
			typeof(HaniwaExploiter),
			typeof(HaniwaSpy),
			typeof(HaniwaMonk),
			typeof(HaniwaCharger),
			typeof(HaniwaSentinel)
		};

		public static readonly List<Type> UncommandableCards = new List<Type>
		{
			typeof(HaniwaBlitz),
			typeof(AshesToClay),
			typeof(LoyaltyCommand),
			typeof(BlitzCommand),
			typeof(VigorousCommand)
		};

		public static List<Type> AllOptionTypes => CommonOptionTypes.Concat(UncommonOptionTypes).ToList();

		public static List<Type> AllSummonTypes => CommonSummonTypes.Concat(UncommonSummonTypes).ToList();

		public static List<Type> GetAllSummonTypes(BattleController battle)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//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)
			ManaGroup baseMana = battle.GameRun.BaseMana;
			bool flag = ((ManaGroup)(ref baseMana)).HasColor((ManaColor)5);
			baseMana = battle.GameRun.BaseMana;
			bool flag2 = ((ManaGroup)(ref baseMana)).HasColor((ManaColor)3);
			bool flag3 = battle.Player.HasExhibit<KongbaiKapai>();
			List<Type> list = new List<Type>();
			if (flag || flag3)
			{
				list.Add(typeof(HaniwaHorseArcher));
			}
			if (flag2 || flag3)
			{
				list.Add(typeof(HaniwaAssassin));
			}
			if (((Unit)battle.Player).HasStatusEffect<ChainOfCommandSe>())
			{
				list.Add(typeof(FrontlineCommander));
				list.Add(typeof(AssignCommander));
			}
			list.AddRange(AllSummonTypes);
			return list;
		}

		public static List<ModFrontlineOptionCard> GetAllOptionCards(BattleController battle, int numberToSpawn = 1, bool checkSacrificeRequirement = false)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//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)
			ManaGroup baseMana = battle.GameRun.BaseMana;
			bool flag = ((ManaGroup)(ref baseMana)).HasColor((ManaColor)5);
			baseMana = battle.GameRun.BaseMana;
			bool flag2 = ((ManaGroup)(ref baseMana)).HasColor((ManaColor)3);
			bool flag3 = battle.Player.HasExhibit<KongbaiKapai>();
			List<Type> list = new List<Type>();
			if (flag || flag3)
			{
				list.Add(typeof(OptionHaniwaHorseArcher));
			}
			if (flag2 || flag3)
			{
				list.Add(typeof(OptionHaniwaAssassin));
			}
			if (((Unit)battle.Player).HasStatusEffect<ChainOfCommandSe>())
			{
				list.Add(typeof(OptionFrontlineCommander));
				list.Add(typeof(OptionAssignCommander));
			}
			list.AddRange(AllOptionTypes);
			return GetOptionCards(list, battle, numberToSpawn, checkSacrificeRequirement);
		}

		public static List<ModFrontlineOptionCard> GetOptionCards(List<Type> types, BattleController battle, int numberToSpawn = 1, bool checkSacrificeRequirement = false)
		{
			List<ModFrontlineOptionCard> list = new List<ModFrontlineOptionCard>();
			foreach (Type type in types)
			{
				ModFrontlineOptionCard modFrontlineOptionCard = Library.CreateCard(type) as ModFrontlineOptionCard;
				((Card)modFrontlineOptionCard).SetBattle(battle);
				modFrontlineOptionCard.NumberToSpawn = numberToSpawn;
				if (checkSacrificeRequirement)
				{
					if (modFrontlineOptionCard.FulfilsRequirement)
					{
						list.Add(modFrontlineOptionCard);
					}
				}
				else
				{
					list.Add(modFrontlineOptionCard);
				}
			}
			return list;
		}

		public static IEnumerable<BattleAction> CardsSummon(IReadOnlyList<Card> modFrontlineCards, int startingUpgrades = 0, int startingLoyalty = 0)
		{
			if (modFrontlineCards == null)
			{
				yield break;
			}
			int totalFencerCost = 0;
			int totalArcherCost = 0;
			int totalCavalryCost = 0;
			List<Card> cardsToSpawn = new List<Card>();
			foreach (Card card in modFrontlineCards)
			{
				if (!(card is ModFrontlineOptionCard optionCard))
				{
					continue;
				}
				totalFencerCost += optionCard.SelectRequireFencer;
				totalArcherCost += optionCard.SelectRequireArcher;
				totalCavalryCost += optionCard.SelectRequireCavalry;
				List<ModFrontlineCard> cards = optionCard.GetCardsToSpawn().Cast<ModFrontlineCard>().ToList();
				if (startingUpgrades > 0)
				{
					cards.ForEach(delegate(ModFrontlineCard c)
					{
						((Card)c).UpgradeCounter = startingUpgrades;
					});
				}
				if (startingLoyalty > 0)
				{
					cards.ForEach(delegate(ModFrontlineCard c)
					{
						c.StartingExtraLoyalty += startingLoyalty;
					});
				}
				cardsToSpawn.AddRange((IEnumerable<Card>)cards);
			}
			yield return (BattleAction)(object)new LoseHaniwaAction(HaniwaActionType.Sacrifice, totalFencerCost, totalArcherCost, totalCavalryCost);
			yield return (BattleAction)new AddCardsToHandAction((IEnumerable<Card>)cardsToSpawn, (AddCardsType)0);
		}

		public static UnitSelector GetTargetForOnPlayAction(BattleController battle)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			EnemyUnit val = battle.AllAliveEnemies.Where((EnemyUnit e) => ((Unit)e).HasStatusEffect<CommandersMarkSe>()).FirstOrDefault();
			if (val != null)
			{
				return new UnitSelector(val);
			}
			return new UnitSelector(battle.RandomAliveEnemy);
		}

		public static IEnumerable<BattleAction> ExecuteOnPlayActions(List<Card> commandedCards, BattleController battle, UnitSelector selector = null, bool consumeRemainingValue = false, string sourceName = "")
		{
			foreach (Card card in commandedCards)
			{
				foreach (BattleAction item in ExecuteOnPlayAction(card, battle, selector, consumeRemainingValue, sourceName))
				{
					yield return item;
				}
			}
		}

		public static IEnumerable<BattleAction> ExecuteOnPlayAction(Card cardToCommand, BattleController battle, UnitSelector selector = null, bool consumeRemainingValue = false, string sourceName = "")
		{
			if (battle.BattleShouldEnd)
			{
				yield break;
			}
			if (battle.HandZone.Contains(cardToCommand))
			{
				cardToCommand.NotifyActivating();
			}
			else
			{
				yield return (BattleAction)(object)PerformAction.ViewCard(cardToCommand);
			}
			Interaction precondition = cardToCommand.Precondition();
			if (precondition != null)
			{
				string commandingCardName = ((sourceName == "") ? "" : (UiUtils.WrapByColor(sourceName, GlobalConfig.EntityColor) + " -> "));
				if (cardToCommand is ModMayumiCard mmc)
				{
					precondition.Description = commandingCardName + mmc.InteractionTitle;
				}
				else
				{
					precondition.Description = commandingCardName + UiUtils.WrapByColor(((GameEntity)cardToCommand).Name, GlobalConfig.EntityColor);
				}
				bool allowCancel = true;
				SelectCardInteraction sci = (SelectCardInteraction)(object)((precondition is SelectCardInteraction) ? precondition : null);
				if (sci != null && sci.Min == 0)
				{
					allowCancel = false;
				}
				SelectHandInteraction shi = (SelectHandInteraction)(object)((precondition is SelectHandInteraction) ? precondition : null);
				if (shi != null && shi.Min == 0)
				{
					allowCancel = false;
				}
				yield return (BattleAction)new InteractionAction(precondition, allowCancel);
				if (precondition.IsCanceled)
				{
					yield break;
				}
			}
			foreach (BattleAction action in cardToCommand.GetActions((selector != null) ? selector : GetTargetForOnPlayAction(battle), ManaGroup.Empty, precondition, false, false, (IList<DamageAction>)new List<DamageAction>()))
			{
				if (!battle.BattleShouldEnd)
				{
					yield return action;
					continue;
				}
				yield break;
			}
			ModFrontlineCard mfc = default(ModFrontlineCard);
			int num;
			if (consumeRemainingValue)
			{
				mfc = cardToCommand as ModFrontlineCard;
				num = ((mfc != null) ? 1 : 0);
			}
			else
			{
				num = 0;
			}
			if (num != 0)
			{
				yield return mfc.ConsumeLoyalty();
			}
			if (cardToCommand.IsExile || (int)cardToCommand.CardType == 4)
			{
				cardToCommand.IsCopy = true;
			}
		}

		public static List<Card> GetCommandableCards(List<Card> potentialCards, Card playedCard = null, bool zeroCostLimit = true)
		{
			return potentialCards.Where((Card c) => c != playedCard && (!zeroCostLimit || c.Cost == ManaGroup.Empty) && !c.HasKeyword((Keyword)32768) && (int)c.CardType != 7 && (int)c.CardType != 8 && c.CanUse && (c is ModFrontlineCard || c.CanBeDuplicated) && !UncommandableCards.Contains(((object)c).GetType())).ToList();
		}
	}
	public static class HaniwaUtils
	{
		public static List<ModHaniwaStatusEffect> GetAllHaniwa(PlayerUnit player)
		{
			List<ModHaniwaStatusEffect> list = new List<ModHaniwaStatusEffect>();
			if (((Unit)player).HasStatusEffect<ArcherHaniwa>())
			{
				list.Add(((Unit)player).GetStatusEffect<ArcherHaniwa>());
			}
			if (((Unit)player).HasStatusEffect<CavalryHaniwa>())
			{
				list.Add(((Unit)player).GetStatusEffect<CavalryHaniwa>());
			}
			if (((Unit)player).HasStatusEffect<FencerHaniwa>())
			{
				list.Add(((Unit)player).GetStatusEffect<FencerHaniwa>());
			}
			return list;
		}

		public static int TotalHaniwaLevel(PlayerUnit player)
		{
			int total = 0;
			List<ModHaniwaStatusEffect> allHaniwa = GetAllHaniwa(player);
			allHaniwa.ForEach(delegate(ModHaniwaStatusEffect st)
			{
				total += ((StatusEffect)st).Level;
			});
			return total;
		}

		public static bool IsLevelFulfilled(PlayerUnit player, HaniwaActionType actionType, int fencerRequired = 0, int archerRequired = 0, int cavalryRequired = 0)
		{
			return IsLevelFulfilled<FencerHaniwa>(player, fencerRequired, actionType) && IsLevelFulfilled<ArcherHaniwa>(player, archerRequired, actionType) && IsLevelFulfilled<CavalryHaniwa>(player, cavalryRequired, actionType);
		}

		public static bool IsLevelFulfilled<T>(PlayerUnit player, int requiredLevel, HaniwaActionType actionType) where T : ModHaniwaStatusEffect
		{
			return IsLevelFulfilled(player, typeof(T), requiredLevel, actionType);
		}

		public static bool IsLevelFulfilled(PlayerUnit player, Type haniwaType, int requiredLevel, HaniwaActionType actionType)
		{
			if (requiredLevel == 0)
			{
				return true;
			}
			if (!((Unit)player).HasStatusEffect(haniwaType))
			{
				return false;
			}
			StatusEffect statusEffect = ((Unit)player).GetStatusEffect(haniwaType);
			return statusEffect.Level >= requiredLevel;
		}

		public static int GetHaniwaLevel<T>(PlayerUnit player) where T : ModHaniwaStatusEffect
		{
			if (!((Unit)player).HasStatusEffect<T>())
			{
				return 0;
			}
			return ((StatusEffect)((Unit)player).GetStatusEffect<T>()).Level;
		}

		public static bool HasAnyHaniwa(PlayerUnit player)
		{
			return GetHaniwaLevel<FencerHaniwa>(player) > 0 || GetHaniwaLevel<ArcherHaniwa>(player) > 0 || GetHaniwaLevel<CavalryHaniwa>(player) > 0;
		}

		public static string CantUseMessages(PlayerUnit player, HaniwaActionType actionType, int fencerRequired = 0, int archerRequired = 0, int cavalryRequired = 0)
		{
			string text = "";
			if (!IsLevelFulfilled<FencerHaniwa>(player, fencerRequired, actionType))
			{
				text += LocSe.NeedMoreFencer();
			}
			if (!IsLevelFulfilled<ArcherHaniwa>(player, archerRequired, actionType))
			{
				text += LocSe.NeedMoreArcher();
			}
			if (!IsLevelFulfilled<CavalryHaniwa>(player, cavalryRequired, actionType))
			{
				text += LocSe.NeedMoreCavalry();
			}
			return text;
		}
	}
}
namespace LBoLMod.UnitModel
{
	public sealed class UnitModel : UnitModelTemplate
	{
		public override IdContainer GetId()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			return ((EntityDefinition)new MayumiPlayerDef()).UniqueId;
		}

		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.unitModelBatchLoc.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("MayumiModel.png", BepinexPlugin.directorySource, 565, (GraphicsFormat)4, 1, (FilterMode)1, (SpriteMeshType)1, (Rect?)null, (Vector2?)null, "file://"));
		}

		public override UniTask<Sprite> LoadSpellSprite()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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)
			return ResourceLoader.LoadSpriteAsync("MayumiStand.png", BepinexPlugin.directorySource, 100, (GraphicsFormat)4, 1, (FilterMode)1, (SpriteMeshType)1, (Rect?)null, (Vector2?)null, "file://");
		}

		public override UnitModelConfig MakeConfig()
		{
			UnitModelConfig val = ((UnitModelTemplate)this).DefaultConfig();
			val.Flip = true;
			val.HasSpellPortrait = true;
			return val;
		}
	}
}
namespace LBoLMod.UltimateSkills
{
	public sealed class AssignUltimateSkillDef : UltimateSkillTemplate
	{
		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("AssignUltimateSkill");
		}

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("dummyicon.png", (IResourceSource)(object)BepinexPlugin.directorySource, (Rect?)null, 1, (Vector2?)null);
		}

		public override UltimateSkillConfig MakeConfig()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			return new UltimateSkillConfig("", 10, 100, 100, 2, (UsRepeatableType)1, 25, 0, 0, (Keyword)256, (IReadOnlyList<string>)new List<string> { "Haniwa", "Assign" }, (IReadOnlyList<string>)new List<string>());
		}
	}
	[EntityLogic(typeof(AssignUltimateSkillDef))]
	public sealed class AssignUltimateSkill : UltimateSkill
	{
		public AssignUltimateSkill()
		{
			((UltimateSkill)this).TargetType = (TargetType)2;
		}

		protected override IEnumerable<BattleAction> Actions(UnitSelector selector)
		{
			PlayerUnit player = ((UltimateSkill)this).Battle.Player;
			yield return (BattleAction)new DamageAction((Unit)(object)player, (IEnumerable<Unit>)(object)selector.GetEnemies(((UltimateSkill)this).Battle), ((UltimateSkill)this).Damage, "Instant", (GunType)0);
		}
	}
	public sealed class FrontlineUltimateSkillDef : UltimateSkillTemplate
	{
		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("FrontlineUltimateSkill");
		}

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

		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("dummyicon.png", (IResourceSource)(object)BepinexPlugin.directorySource, (Rect?)null, 1, (Vector2?)null);
		}

		public override UltimateSkillConfig MakeConfig()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			return new UltimateSkillConfig("", 10, 100, 100, 2, (UsRepeatableType)1, 0, 5, 3, (Keyword)0, (IReadOnlyList<string>)new List<string> { "Haniwa", "Frontline" }, (IReadOnlyList<string>)new List<string> { "HaniwaAttacker", "HaniwaBodyguard", "HaniwaUpgrader", "HaniwaExploiter" });
		}
	}
	[EntityLogic(typeof(FrontlineUltimateSkillDef))]
	public sealed class FrontlineUltimateSkill : UltimateSkill
	{
		public string InteractionTitle => RuntimeFormatterExtensions.RuntimeFormat(((GameEntity)this).LocalizeProperty("InteractionTitle", false, true), ((GameEntity)this).FormatWrapper);

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

		protected override IEnumerable<BattleAction> Actions(UnitSelector selector)
		{
			yield return (BattleAction)(object)new GainHaniwaAction(((UltimateSkill)this).Value1, ((UltimateSkill)this).Value1, ((UltimateSkill)this).Value1);
			yield return (BattleAction)(object)PerformAction.Wait(0.2f, false);
			List<ModFrontlineOptionCard> cards = HaniwaFrontlineUtils.GetAllOptionCards(((UltimateSkill)this).Battle, 1, checkSacrificeRequirement: true);
			SelectCardInteraction selectCardInteraction = new SelectCardInteraction(0, ((UltimateSkill)this).Value2, (IEnumerable<Card>)cards, (SelectedCardHandling)0);
			((Interaction)selectCardInteraction).Description = InteractionTitle;
			yield return (BattleAction)new InteractionAction((Interaction)(object)selectCardInteraction, false);
			foreach (BattleAction action in HaniwaFrontlineUtils.CardsSummon(selectCardInteraction.SelectedCards))
			{
				AddCardsToHandAction addHand = (AddCardsToHandAction)(object)((action is AddCardsToHandAction) ? action : null);
				if (addHand != null)
				{
					List<Card> beforeList = new List<Card>(((EventBattleAction<CardsEventArgs>)(object)addHand).Args.Cards);
					yield return (BattleAction)(object)addHand;
					List<Card> afterList = new List<Card>(((EventBattleAction<CardsEventArgs>)(object)addHand).Args.Cards);
					if (beforeList.Count != afterList.Count)
					{
						beforeList.RemoveAll((Card c) => afterList.Contains(c));
						yield return (BattleAction)new AddCardsToDrawZoneAction((IEnumerable<Card>)beforeList, (DrawZoneTarget)2, (AddCardsType)0);
					}
				}
				else
				{
					yield return action;
				}
			}
		}
	}
}
namespace LBoLMod.StatusEffects
{
	public sealed class ArcherHaniwaDef : ModStatusEffectTemplate
	{
		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("ArcherHaniwa");
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.Order = 12;
			val.RelativeEffects = new List<string> { "Haniwa" };
			return val;
		}
	}
	[EntityLogic(typeof(ArcherHaniwaDef))]
	public sealed class ArcherHaniwa : ModHaniwaStatusEffect
	{
		protected override void OnAdding(Unit unit)
		{
			base.OnAdding(unit);
		}
	}
	public sealed class CavalryHaniwaDef : ModStatusEffectTemplate
	{
		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("CavalryHaniwa");
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.Order = 13;
			val.RelativeEffects = new List<string> { "Haniwa" };
			return val;
		}
	}
	[EntityLogic(typeof(CavalryHaniwaDef))]
	public sealed class CavalryHaniwa : ModHaniwaStatusEffect
	{
		protected override void OnAdding(Unit unit)
		{
			base.OnAdding(unit);
		}
	}
	public sealed class FencerHaniwaDef : ModStatusEffectTemplate
	{
		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("FencerHaniwa");
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.Order = 11;
			val.RelativeEffects = new List<string> { "Haniwa" };
			return val;
		}
	}
	[EntityLogic(typeof(FencerHaniwaDef))]
	public sealed class FencerHaniwa : ModHaniwaStatusEffect
	{
		protected override void OnAdding(Unit unit)
		{
			base.OnAdding(unit);
		}
	}
	public abstract class ModAssignStatusEffect : StatusEffect
	{
		public bool JustApplied { get; set; } = true;


		public ModAssignCard AssignSourceCard { get; set; }

		public int CardFencerAssigned { get; set; } = 0;


		public int CardArcherAssigned { get; set; } = 0;


		public int CardCavalryAssigned { get; set; } = 0;


		protected int StartingCardCounter => AssignSourceCard.StartingCardCounter;

		protected DamageInfo CardDamage => ((Card)AssignSourceCard).Damage;

		protected int CardBlock => ((Card)AssignSourceCard).RawBlock;

		protected int CardShield => ((Card)AssignSourceCard).RawShield;

		protected ManaGroup CardMana => ((Card)AssignSourceCard).Mana;

		protected int CardValue1 => ((Card)AssignSourceCard).Value1;

		protected int CardValue2 => ((Card)AssignSourceCard).Value2;

		protected ScryInfo CardScry => ((Card)AssignSourceCard).Scry;

		public bool IsPermanent { get; set; } = false;


		protected IEnumerable<EnemyUnit> MarkedEnemies => ((StatusEffect)this).Battle.AllAliveEnemies.Where((EnemyUnit e) => ((Unit)e).HasStatusEffect<AssignmentMarkSe>());

		protected override void OnAdded(Unit unit)
		{
			if (((StatusEffect)this).SourceCard is ModAssignCard assignSourceCard)
			{
				AssignSourceCard = assignSourceCard;
				if (AssignSourceCard.ShouldAssignHaniwa)
				{
					CardFencerAssigned += AssignSourceCard.FencerAssigned;
					CardArcherAssigned += AssignSourceCard.ArcherAssigned;
					CardCavalryAssigned += AssignSourceCard.CavalryAssigned;
				}
			}
			((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
			((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnStarted, (EventSequencedReactor<UnitEventArgs>)onPlayerTurnStarted);
			((StatusEffect)this).HandleOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnEnded, (GameEventHandler<UnitEventArgs>)onPlayerTurnEnded);
			((StatusEffect)this).ReactOwnerEvent<UsUsingEventArgs>(((StatusEffect)this).Battle.UsUsed, (EventSequencedReactor<UsUsingEventArgs>)OnUltimateSkillUsed);
		}

		public override bool Stack(StatusEffect other)
		{
			if (other.SourceCard is ModAssignCard modAssignCard && !modAssignCard.ShouldStack)
			{
				return false;
			}
			((StatusEffect)this).Stack(other);
			((StatusEffect)this).Count = ((StatusEffect)this).Count + 3;
			if (!((StatusEffect)this).SourceCard.IsUpgraded && other.SourceCard.IsUpgraded && other.SourceCard is ModAssignCard assignSourceCard)
			{
				AssignSourceCard = assignSourceCard;
			}
			if (other.SourceCard is ModAssignCard modAssignCard2 && modAssignCard2.ShouldAssignHaniwa)
			{
				CardFencerAssigned += ((AssignSourceCard.FencerAssigned > 0) ? 1 : 0);
				CardArcherAssigned += ((AssignSourceCard.ArcherAssigned > 0) ? 1 : 0);
				CardCavalryAssigned += ((AssignSourceCard.CavalryAssigned > 0) ? 1 : 0);
			}
			return true;
		}

		public void MakePermanent()
		{
			IsPermanent = true;
		}

		public void IncreaseTaskLevel(int amount)
		{
			((StatusEffect)this).Level = ((StatusEffect)this).Level + amount;
		}

		public void Tickdown(int amount)
		{
			if (((Unit)((StatusEffect)this).Battle.Player).HasStatusEffect<AssignReverseTickdownSe>())
			{
				((StatusEffect)this).Count = ((StatusEffect)this).Count + amount;
			}
			else if (((StatusEffect)this).Count - amount >= 0)
			{
				((StatusEffect)this).Count = ((StatusEffect)this).Count - amount;
			}
			else
			{
				((StatusEffect)this).Count = 0;
			}
		}

		public IEnumerable<BattleAction> ImmidiatelyTrigger()
		{
			((StatusEffect)this).Count = 0;
			return AssignTriggering(onTurnStart: false);
		}

		private IEnumerable<BattleAction> OnUltimateSkillUsed(UsUsingEventArgs args)
		{
			if (args.Us is AssignUltimateSkill)
			{
				return AssignTriggering(onTurnStart: false);
			}
			return null;
		}

		private void onPlayerTurnEnded(UnitEventArgs args)
		{
			Tickdown(3);
		}

		private IEnumerable<BattleAction> onPlayerTurnStarted(UnitEventArgs args)
		{
			if (((StatusEffect)this).Count == 0)
			{
				return AssignTriggering(onTurnStart: true);
			}
			return null;
		}

		private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
		{
			AssignSourceCard.ManualStack = true;
			if (!JustApplied)
			{
				Tickdown(1);
				AssignCostTaskLevelSe assignCostTaskLevelSe = default(AssignCostTaskLevelSe);
				int num = (((Unit)((StatusEffect)this).Battle.Player).TryGetStatusEffect<AssignCostTaskLevelSe>(ref assignCostTaskLevelSe) ? ((StatusEffect)assignCostTaskLevelSe).Level : 0);
				((StatusEffect)this).Level = ((StatusEffect)this).Level + (MathExtensions.RoundToInt(Math.Ceiling((double)(CardFencerAssigned + CardArcherAssigned + CardCavalryAssigned) / 2.0)) + num);
			}
			JustApplied = false;
			if (((StatusEffect)this).Count == 0)
			{
				return AssignTriggering(onTurnStart: false);
			}
			return null;
		}

		private IEnumerable<BattleAction> AssignTriggering(bool onTurnStart, bool shouldRemove = true)
		{
			if (((StatusEffect)this).Battle.BattleShouldEnd)
			{
				yield break;
			}
			((StatusEffect)this).NotifyActivating();
			yield return (BattleAction)(object)new AssignTriggerAction(this, onTurnStart);
			if (((StatusEffect)this).Battle.BattleShouldEnd)
			{
				yield break;
			}
			if (IsPermanent)
			{
				int fencerRequired = ((CardFencerAssigned > 0) ? 1 : 0);
				int archerRequired = ((CardArcherAssigned > 0) ? 1 : 0);
				int cavalryRequired = ((CardCavalryAssigned > 0) ? 1 : 0);
				if (CardFencerAssigned == 1 || CardArcherAssigned == 1 || CardCavalryAssigned == 1)
				{
					int hpLoss = fencerRequired + archerRequired + cavalryRequired;
					yield return (BattleAction)new DamageAction((Unit)(object)((StatusEffect)this).Battle.Player, (Unit)(object)((StatusEffect)this).Battle.Player, DamageInfo.HpLose((float)hpLoss, false), "Instant", (GunType)0);
				}
				((StatusEffect)this).Count = 5;
				((StatusEffect)this).Level = Math.Max(AssignSourceCard.StartingTaskLevel, ((StatusEffect)this).Level / 2);
				CardFencerAssigned = Math.Max(fencerRequired, CardFencerAssigned - fencerRequired);
				CardArcherAssigned = Math.Max(archerRequired, CardArcherAssigned - archerRequired);
				CardCavalryAssigned = Math.Max(cavalryRequired, CardCavalryAssigned - cavalryRequired);
			}
			else
			{
				if (!shouldRemove)
				{
					yield break;
				}
				foreach (BattleAction item in RemoveBuff())
				{
					yield return item;
				}
			}
		}

		public IEnumerable<BattleAction> RemoveBuff()
		{
			yield return (BattleAction)(object)new GainHaniwaAction(CardFencerAssigned, CardArcherAssigned, CardCavalryAssigned, isFromAssign: true);
			yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
		}

		public abstract IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart);

		public virtual IEnumerable<BattleAction> BeforeAssignmentDone(bool onTurnStart)
		{
			return new List<BattleAction>();
		}

		public virtual IEnumerable<BattleAction> AfterAssignmentDone(bool onTurnStart)
		{
			return new List<BattleAction>();
		}
	}
	public abstract class ModAssignStatusEffectTemplate : ModStatusEffectTemplate
	{
		public override StatusEffectConfig MakeConfig()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			return new StatusEffectConfig(0, "", 15, (StatusEffectType)0, false, true, (int?)null, true, (StackType?)(StackType)0, false, (StackType?)(StackType)0, (DurationDecreaseTiming)0, true, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (string)null, "Default", "Default", "Default");
		}
	}
	public abstract class ModHaniwaStatusEffect : StatusEffect
	{
		private int AdditionalMaxLevel
		{
			get
			{
				if (((StatusEffect)this).Battle == null)
				{
					return 0;
				}
				MaxHaniwaUpSe maxHaniwaUpSe = default(MaxHaniwaUpSe);
				if (((Unit)((StatusEffect)this).Battle.Player).TryGetStatusEffect<MaxHaniwaUpSe>(ref maxHaniwaUpSe))
				{
					return ((StatusEffect)maxHaniwaUpSe).Level;
				}
				return 0;
			}
		}

		private int MaxLevel => 10 + AdditionalMaxLevel;

		protected override void OnAdding(Unit unit)
		{
			if (((StatusEffect)this).Level > MaxLevel)
			{
				((StatusEffect)this).Level = MaxLevel;
			}
		}

		public override bool Stack(StatusEffect other)
		{
			((StatusEffect)this).Stack(other);
			if (((StatusEffect)this).Level > MaxLevel)
			{
				((StatusEffect)this).Level = MaxLevel;
			}
			return true;
		}
	}
	public abstract class ModStatusEffectTemplate : StatusEffectTemplate
	{
		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.StatusEffectsBatchLoc.AddEntity((EntityDefinition)(object)this);
		}

		public override Sprite LoadSprite()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			Sprite val = ResourceLoader.LoadSprite(IdContainer.op_Implicit(((EntityDefinition)this).GetId()) + ".png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
			if ((Object)(object)val == (Object)null)
			{
				return ResourceLoader.LoadSprite("dummyicon.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
			}
			return val;
		}

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			return new StatusEffectConfig(0, "", 17, (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>(), (string)null, "Default", "Default", "Default");
		}
	}
}
namespace LBoLMod.StatusEffects.Localization
{
	public sealed class LocSeDef : ModStatusEffectTemplate
	{
		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("LocSe");
		}
	}
	[EntityLogic(typeof(LocSeDef))]
	public sealed class LocSe : StatusEffect
	{
		private static LocSe _instance;

		public static LocSe Instance
		{
			get
			{
				if (_instance == null)
				{
					_instance = Library.CreateStatusEffect<LocSe>();
				}
				return _instance;
			}
		}

		public static string LocalizeProp(string key, bool decorate = false, bool required = true)
		{
			return ((GameEntity)Instance).LocalizeProperty(key, decorate, required);
		}

		public static string FrontlineKeyword()
		{
			return LocalizeProp("FrontlineKeyword");
		}

		public static string AssignKeyword()
		{
			return LocalizeProp("AssignKeyword");
		}

		public static string NeedMoreFencer()
		{
			return LocalizeProp("NeedFencerText");
		}

		public static string NeedMoreArcher()
		{
			return LocalizeProp("NeedArcherText");
		}

		public static string NeedMoreCavalry()
		{
			return LocalizeProp("NeedCavalryText");
		}

		public static string RequiresHaniwa()
		{
			return LocalizeProp("RequiresHaniwaText");
		}
	}
}
namespace LBoLMod.StatusEffects.Keywords
{
	public sealed class AssignDef : ModStatusEffectTemplate
	{
		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("Assign");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.RelativeEffects = new List<string> { "TaskLevel" };
			return val;
		}
	}
	[EntityLogic(typeof(AssignDef))]
	public sealed class Assign : StatusEffect
	{
	}
	public sealed class CommandDef : ModStatusEffectTemplate
	{
		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("Command");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.Keywords = (Keyword)65668;
			val.RelativeEffects = new List<string> { "Frontline" };
			return val;
		}
	}
	[EntityLogic(typeof(CommandDef))]
	public sealed class Command : StatusEffect
	{
	}
	public sealed class FrontlineDef : ModStatusEffectTemplate
	{
		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("Frontline");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.Keywords = (Keyword)65536;
			val.RelativeEffects = new List<string> { "Loyalty", "Haniwa" };
			return val;
		}
	}
	[EntityLogic(typeof(FrontlineDef))]
	public sealed class Frontline : StatusEffect
	{
	}
	public sealed class HaniwaDef : ModStatusEffectTemplate
	{
		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("Haniwa");
		}
	}
	[EntityLogic(typeof(HaniwaDef))]
	public sealed class Haniwa : StatusEffect
	{
	}
	public sealed class LoyaltyDef : ModStatusEffectTemplate
	{
		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("Loyalty");
		}
	}
	[EntityLogic(typeof(LoyaltyDef))]
	public sealed class Loyalty : StatusEffect
	{
	}
	public sealed class PermanentDef : ModStatusEffectTemplate
	{
		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("Permanent");
		}
	}
	[EntityLogic(typeof(PermanentDef))]
	public sealed class Permanent : StatusEffect
	{
	}
	public sealed class RequireDef : ModStatusEffectTemplate
	{
		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("Require");
		}
	}
	[EntityLogic(typeof(RequireDef))]
	public sealed class Require : StatusEffect
	{
	}
	public sealed class SacrificeDef : ModStatusEffectTemplate
	{
		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("Sacrifice");
		}
	}
	[EntityLogic(typeof(SacrificeDef))]
	public sealed class Sacrifice : StatusEffect
	{
	}
	public sealed class TaskLevelDef : ModStatusEffectTemplate
	{
		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("TaskLevel");
		}
	}
	[EntityLogic(typeof(TaskLevelDef))]
	public sealed class TaskLevel : StatusEffect
	{
	}
}
namespace LBoLMod.StatusEffects.Debuffs
{
	public sealed class AssignmentMarkSeDef : ModStatusEffectTemplate
	{
		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("AssignmentMarkSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.Type = (StatusEffectType)1;
			val.HasLevel = false;
			val.HasDuration = true;
			val.DurationDecreaseTiming = (DurationDecreaseTiming)48;
			val.VFX = "DebuffBlue";
			return val;
		}
	}
	[EntityLogic(typeof(AssignmentMarkSeDef))]
	public sealed class AssignmentMarkSe : StatusEffect
	{
	}
}
namespace LBoLMod.StatusEffects.Assign
{
	public sealed class AssignArcherPrepDebuffDef : ModAssignStatusEffectTemplate
	{
		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("AssignArcherPrepDebuff");
		}
	}
	[EntityLogic(typeof(AssignArcherPrepDebuffDef))]
	public sealed class AssignArcherPrepDebuff : ModAssignStatusEffect
	{
		public int DivideDmg => 2;

		public int TotalDmg => ((StatusEffect)this).Level / DivideDmg;

		public int TotalVuln => Math.Max(((StatusEffect)this).Level / base.CardValue1, 1);

		public int TotalLockon => Math.Max(((StatusEffect)this).Level / base.CardValue2, 1);

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			DamageInfo accurateDmg = DamageInfo.Attack((float)TotalDmg, true);
			yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (IEnumerable<Unit>)((StatusEffect)this).Battle.AllAliveEnemies, accurateDmg, "Instant", (GunType)0);
			if (((StatusEffect)this).Battle.BattleShouldEnd)
			{
				yield break;
			}
			foreach (BattleAction item in ((StatusEffect)this).DebuffAction<Vulnerable>((IEnumerable<Unit>)((StatusEffect)this).Battle.AllAliveEnemies, 0, TotalVuln, 0, 0, true, 0.2f))
			{
				yield return item;
			}
			foreach (BattleAction item2 in ((StatusEffect)this).DebuffAction<LockedOn>((IEnumerable<Unit>)((StatusEffect)this).Battle.AllAliveEnemies, TotalLockon, 0, 0, 0, true, 0.2f))
			{
				yield return item2;
			}
		}
	}
	public sealed class AssignArcherPrepFrostArrowDef : ModAssignStatusEffectTemplate
	{
		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("AssignArcherPrepFrostArrow");
		}
	}
	[EntityLogic(typeof(AssignArcherPrepFrostArrowDef))]
	public sealed class AssignArcherPrepFrostArrow : ModAssignStatusEffect
	{
		public int TotalTimes => Math.Max(((StatusEffect)this).Level / base.CardValue1, 1);

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

		private IEnumerable<BattleAction> OnDamageDealt(DamageEventArgs args)
		{
			if (((GameEventArgs)args).ActionSource == this && args.Target.HasStatusEffect<Cold>())
			{
				PlayerUnit player = ((StatusEffect)this).Battle.Player;
				yield return (BattleAction)new CastBlockShieldAction((Unit)(object)player, (Unit)(object)player, ((Card)base.AssignSourceCard).Block, true);
			}
		}

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			for (int i = 0; i < TotalTimes; i++)
			{
				if (((StatusEffect)this).Battle.BattleShouldEnd)
				{
					break;
				}
				EnemyUnit markedEnemy = CollectionsExtensions.SampleOrDefault<EnemyUnit>(base.MarkedEnemies, ((StatusEffect)this).Battle.GameRun.BattleRng);
				EnemyUnit target = ((markedEnemy != null) ? markedEnemy : ((StatusEffect)this).Battle.RandomAliveEnemy);
				yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)target, ((Card)base.AssignSourceCard).Damage, "Instant", (GunType)0);
				yield return ((StatusEffect)this).DebuffAction<Cold>((Unit)(object)target, 0, 0, 0, 0, true, 0.2f);
			}
		}
	}
	public sealed class AssignArcherPrepVolleyDef : ModAssignStatusEffectTemplate
	{
		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("AssignArcherPrepVolley");
		}
	}
	[EntityLogic(typeof(AssignArcherPrepVolleyDef))]
	public sealed class AssignArcherPrepVolley : ModAssignStatusEffect
	{
		public int TotalTimes => Math.Max(((StatusEffect)this).Level / base.CardValue1, 1);

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			for (int i = 0; i < TotalTimes; i++)
			{
				if (((StatusEffect)this).Battle.BattleShouldEnd)
				{
					break;
				}
				EnemyUnit markedEnemy = CollectionsExtensions.SampleOrDefault<EnemyUnit>(base.MarkedEnemies, ((StatusEffect)this).Battle.GameRun.BattleRng);
				yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)((markedEnemy != null) ? markedEnemy : ((StatusEffect)this).Battle.RandomAliveEnemy), ((Card)base.AssignSourceCard).Damage, "Instant", (GunType)0);
			}
		}
	}
	public sealed class AssignBuildWatchtowerDef : ModAssignStatusEffectTemplate
	{
		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("AssignBuildWatchtower");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.RelativeEffects = new List<string> { "Watchtower" };
			return val;
		}
	}
	[EntityLogic(typeof(AssignBuildWatchtowerDef))]
	public sealed class AssignBuildWatchtower : ModAssignStatusEffect
	{
		public int TotalWatchtower => ((StatusEffect)this).Level / base.CardValue1;

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			yield return (BattleAction)(object)new ApplyStatusEffectAction<Watchtower>(((StatusEffect)this).Owner, (int?)TotalWatchtower, (int?)null, (int?)null, (int?)null, 0f, true);
		}
	}
	public sealed class AssignCavalryRushDef : ModAssignStatusEffectTemplate
	{
		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("AssignCavalryRush");
		}
	}
	[EntityLogic(typeof(AssignCavalryRushDef))]
	public sealed class AssignCavalryRush : ModAssignStatusEffect
	{
		public DamageInfo TotalDamage
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				DamageInfo cardDamage = base.CardDamage;
				return ((DamageInfo)(ref cardDamage)).MultiplyBy(((StatusEffect)this).Level);
			}
		}

		public int TotalCommandableCount => Math.Max(((StatusEffect)this).Level / base.CardValue1, 1);

		protected override void OnAdded(Unit unit)
		{
			base.OnAdded(unit);
		}

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			EnemyUnit markedEnemy = CollectionsExtensions.MinByOrDefault<EnemyUnit, int>(base.MarkedEnemies, (Func<EnemyUnit, int>)((EnemyUnit e) => ((Unit)e).Hp));
			EnemyUnit target = ((markedEnemy != null) ? markedEnemy : ((StatusEffect)this).Battle.LowestHpEnemy);
			yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)target, TotalDamage, "Instant", (GunType)0);
			yield return (BattleAction)(object)PerformAction.Wait(0.3f, false);
			if (!((StatusEffect)this).Battle.BattleShouldEnd)
			{
				List<Card> randomCommandedCards = CollectionsExtensions.SampleManyOrAll<Card>((IEnumerable<Card>)HaniwaFrontlineUtils.GetCommandableCards(((StatusEffect)this).Battle.HandZone.ToList()), TotalCommandableCount, ((GameEntity)this).GameRun.BattleRng).ToList();
				if (randomCommandedCards.Any())
				{
					yield return (BattleAction)(object)new CommandAction(randomCommandedCards, new UnitSelector(target), shouldConsumeLoyalty: false, ((GameEntity)this).Name);
				}
			}
		}
	}
	public sealed class AssignCavalryScoutDef : ModAssignStatusEffectTemplate
	{
		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("AssignCavalryScout");
		}
	}
	[EntityLogic(typeof(AssignCavalryScoutDef))]
	public sealed class AssignCavalryScout : ModAssignStatusEffect
	{
		public ScryInfo TotalScry => new ScryInfo(((StatusEffect)this).Level / base.CardValue1);

		public int TotalAssignmentBonus => Math.Max(((StatusEffect)this).Level / base.CardValue2, 1);

		public string InteractionTitle => RuntimeFormatterExtensions.RuntimeFormat(((GameEntity)this).LocalizeProperty("InteractionTitle", true, true), ((GameEntity)this).FormatWrapper);

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			yield return (BattleAction)(object)new DescriptiveScryAction(TotalScry, InteractionTitle);
			yield return ((StatusEffect)this).BuffAction<AssignmentBonusSe>(TotalAssignmentBonus, 0, 0, 0, 0.2f);
			if (onTurnStart)
			{
				yield return (BattleAction)new DrawCardAction();
			}
		}
	}
	public sealed class AssignCavalrySuppliesDef : ModAssignStatusEffectTemplate
	{
		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("AssignCavalrySupplies");
		}
	}
	[EntityLogic(typeof(AssignCavalrySuppliesDef))]
	public sealed class AssignCavalrySupplies : ModAssignStatusEffect
	{
		public int TotalTimes => Math.Max(base.CardValue2 + ((StatusEffect)this).Level / base.CardValue1, 2);

		public string InteractionTitle => RuntimeFormatterExtensions.RuntimeFormat(((GameEntity)this).LocalizeProperty("InteractionTitle", true, true), ((GameEntity)this).FormatWrapper);

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			List<Card> randomChoices = new List<Card>();
			for (int i = 0; i < TotalTimes; i++)
			{
				int rng = ((GameEntity)this).GameRun.BattleRng.NextInt(1, 100);
				if (rng >= 1 && rng <= 15)
				{
					randomChoices.Add((Card)(object)Library.CreateCard<RManaCard>());
				}
				else if (rng >= 16 && rng <= 30)
				{
					randomChoices.Add((Card)(object)Library.CreateCard<WManaCard>());
				}
				else if (rng >= 31 && rng <= 35)
				{
					randomChoices.Add((Card)(object)Library.CreateCard<PManaCard>());
				}
				else if (rng >= 36 && rng <= 100)
				{
					randomChoices.Add(Library.CreateCard(CollectionsExtensions.Sample<Type>((IEnumerable<Type>)HaniwaFrontlineUtils.GetAllSummonTypes(((StatusEffect)this).Battle), ((GameEntity)this).GameRun.BattleRng)));
				}
			}
			randomChoices.ForEach(delegate(Card c)
			{
				c.IsReplenish = true;
			});
			SelectCardInteraction interaction = new SelectCardInteraction(0, 1, (IEnumerable<Card>)randomChoices, (SelectedCardHandling)0)
			{
				Description = InteractionTitle
			};
			yield return (BattleAction)new InteractionAction((Interaction)(object)interaction, false);
			yield return (BattleAction)new AddCardsToDrawZoneAction((IEnumerable<Card>)interaction.SelectedCards, (DrawZoneTarget)2, (AddCardsType)0);
			yield return (BattleAction)new AddCardsToDiscardAction(randomChoices.Except(interaction.SelectedCards), (AddCardsType)0);
		}
	}
	public sealed class AssignChargeAttackDef : ModAssignStatusEffectTemplate
	{
		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("AssignChargeAttack");
		}
	}
	[EntityLogic(typeof(AssignChargeAttackDef))]
	public sealed class AssignChargeAttack : ModAssignStatusEffect
	{
		public DamageInfo TotalDamage
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				DamageInfo cardDamage = base.CardDamage;
				return ((DamageInfo)(ref cardDamage)).MultiplyBy(((StatusEffect)this).Level);
			}
		}

		protected override void OnAdded(Unit unit)
		{
			base.OnAdded(unit);
			((StatusEffect)this).HandleOwnerEvent<AssignTriggerEventArgs>(ModGameEvents.AssignEffectTriggered, (GameEventHandler<AssignTriggerEventArgs>)OnAssignTriggered);
		}

		private void OnAssignTriggered(AssignTriggerEventArgs args)
		{
			((StatusEffect)this).Level = ((StatusEffect)this).Level + base.CardValue1;
		}

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			EnemyUnit markedEnemy = CollectionsExtensions.MaxByOrDefault<EnemyUnit, int>(base.MarkedEnemies, (Func<EnemyUnit, int>)((EnemyUnit e) => ((Unit)e).Hp));
			yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)((markedEnemy != null) ? markedEnemy : ((StatusEffect)this).Battle.HighestHpEnemy), TotalDamage, "Instant", (GunType)0);
		}
	}
	public sealed class AssignFencerBuildBarricadeDef : ModAssignStatusEffectTemplate
	{
		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("AssignFencerBuildBarricade");
		}
	}
	[EntityLogic(typeof(AssignFencerBuildBarricadeDef))]
	public sealed class AssignFencerBuildBarricade : ModAssignStatusEffect
	{
		public int TotalBarrier => ((StatusEffect)this).Level / base.CardValue1;

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			yield return (BattleAction)new CastBlockShieldAction((Unit)(object)((StatusEffect)this).Battle.Player, new ShieldInfo(TotalBarrier, (BlockShieldType)1), true);
		}
	}
	public sealed class AssignFencerPrepCounterDef : ModAssignStatusEffectTemplate
	{
		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("AssignFencerPrepCounter");
		}
	}
	[EntityLogic(typeof(AssignFencerPrepCounterDef))]
	public sealed class AssignFencerPrepCounter : ModAssignStatusEffect
	{
		private List<Unit> enemiesThatAttackedPlayer = new List<Unit>();

		public IEnumerable<Unit> EnemiesThatAttackedPlayerAlive => base.MarkedEnemies.Any() ? enemiesThatAttackedPlayer.Where((Unit e) => e.IsAlive && ((IEnumerable<Unit>)base.MarkedEnemies).Contains(e)) : enemiesThatAttackedPlayer.Where((Unit e) => e.IsAlive);

		public int EnemiesThatAttackedPlayerCount => EnemiesThatAttackedPlayerAlive.Count();

		public DamageInfo TotalDamage
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				DamageInfo cardDamage = base.CardDamage;
				return ((DamageInfo)(ref cardDamage)).IncreaseBy(((StatusEffect)this).Level / Math.Max(EnemiesThatAttackedPlayerCount, 1));
			}
		}

		public int TotalBlock => base.CardBlock * ((StatusEffect)this).Battle.AllAliveEnemies.Sum((EnemyUnit e) => e.Intentions.Where((Intention i) => i is AttackIntention).Cast<AttackIntention>().Sum((AttackIntention ai) => (!ai.Times.HasValue) ? 1 : ai.Times.GetValueOrDefault()));

		protected override void OnAdded(Unit unit)
		{
			base.OnAdded(unit);
			((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((StatusEffect)this).Owner.TurnEnded, (EventSequencedReactor<UnitEventArgs>)OnTurnEnded);
			((StatusEffect)this).HandleOwnerEvent<DamageEventArgs>(((StatusEffect)this).Owner.DamageReceived, (GameEventHandler<DamageEventArgs>)OnDamageReceived);
		}

		private IEnumerable<BattleAction> OnTurnEnded(UnitEventArgs args)
		{
			yield return (BattleAction)new CastBlockShieldAction(((StatusEffect)this).Owner, new BlockInfo(TotalBlock, (BlockShieldType)1), true);
		}

		private void OnDamageReceived(DamageEventArgs args)
		{
			Unit source = args.Source;
			EnemyUnit val = (EnemyUnit)(object)((source is EnemyUnit) ? source : null);
			if (val != null && !enemiesThatAttackedPlayer.Contains((Unit)(object)val))
			{
				enemiesThatAttackedPlayer.Add((Unit)(object)val);
			}
			((StatusEffect)this).Level = ((StatusEffect)this).Level + base.CardValue1;
		}

		public override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			List<Unit> toAttack = ((EnemiesThatAttackedPlayerCount > 0) ? EnemiesThatAttackedPlayerAlive.ToList() : new List<Unit> { (Unit)(object)(base.MarkedEnemies.Any() ? CollectionsExtensions.SampleOrDefault<EnemyUnit>(base.MarkedEnemies, ((StatusEffect)this).Battle.GameRun.BattleRng) : ((StatusEffect)this).Battle.RandomAliveEnemy) });
			yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (IEnumerable<Unit>)toAttack, TotalDamage, "Instant", (GunType)0);
		}
	}
}
namespace LBoLMod.StatusEffects.Abilities
{
	public sealed class ArcherWorshippingSeDef : ModStatusEffectTemplate
	{
		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("ArcherWorshippingSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasCount = true;
			return val;
		}
	}
	[EntityLogic(typeof(ArcherWorshippingSeDef))]
	public sealed class ArcherWorshippingSe : StatusEffect
	{
		public int Threshold => 5;

		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<GainHaniwaEventArgs>(ModGameEvents.GainedHaniwa, (EventSequencedReactor<GainHaniwaEventArgs>)OnGainedHaniwa);
		}

		private IEnumerable<BattleAction> OnGainedHaniwa(GainHaniwaEventArgs args)
		{
			if (args.ArcherToGain <= 0)
			{
				yield break;
			}
			((StatusEffect)this).Count = ((StatusEffect)this).Count + args.ArcherToGain;
			int timesToActivate = ((StatusEffect)this).Count / Threshold;
			if (((StatusEffect)this).Count >= Threshold)
			{
				((StatusEffect)this).Count = ((StatusEffect)this).Count - Threshold * timesToActivate;
			}
			if (timesToActivate <= 0)
			{
				yield break;
			}
			<>n__0();
			for (int i = 0; i < timesToActivate * ((StatusEffect)this).Level; i++)
			{
				switch (((GameEntity)this).GameRun.BattleRng.NextInt(1, 5))
				{
				case 1:
					yield return ((StatusEffect)this).DebuffAction<Weak>((Unit)(object)((StatusEffect)this).Battle.RandomAliveEnemy, 0, 2, 0, 0, true, 0.2f);
					break;
				case 2:
					yield return ((StatusEffect)this).DebuffAction<Vulnerable>((Unit)(object)((StatusEffect)this).Battle.RandomAliveEnemy, 0, 2, 0, 0, true, 0.2f);
					break;
				case 3:
					yield return ((StatusEffect)this).DebuffAction<TempFirepowerNegative>((Unit)(object)((StatusEffect)this).Battle.RandomAliveEnemy, 3, 0, 0, 0, true, 0.2f);
					break;
				case 4:
					yield return ((StatusEffect)this).DebuffAction<LockedOn>((Unit)(object)((StatusEffect)this).Battle.RandomAliveEnemy, 5, 0, 0, 0, true, 0.2f);
					break;
				case 5:
					yield return ((StatusEffect)this).DebuffAction<Poison>((Unit)(object)((StatusEffect)this).Battle.RandomAliveEnemy, 5, 0, 0, 0, true, 0.2f);
					break;
				}
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class AssignCostTaskLevelSeDef : ModStatusEffectTemplate
	{
		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("AssignCostTaskLevelSe");
		}
	}
	[EntityLogic(typeof(AssignCostTaskLevelSeDef))]
	public sealed class AssignCostTaskLevelSe : StatusEffect
	{
		public ManaGroup IncreasedCost => ManaGroup.Anys(1);

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

		private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
		{
			if (args.Card is ModAssignCard)
			{
				yield return (BattleAction)new GainTurnManaAction(args.ConsumingMana);
			}
		}
	}
	public sealed class AssignPlayDrawSeDef : ModStatusEffectTemplate
	{
		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("AssignPlayDrawSe");
		}
	}
	[EntityLogic(typeof(AssignPlayDrawSeDef))]
	public sealed class AssignPlayDrawSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
		}

		private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
		{
			AssignmentBonusSe bonus = default(AssignmentBonusSe);
			if (((StatusEffect)this).Battle != null && !((StatusEffect)this).Battle.BattleShouldEnd && ((StatusEffect)this).Battle.HandZone.Count != ((StatusEffect)this).Battle.MaxHand && ((Unit)((StatusEffect)this).Battle.Player).TryGetStatusEffect<AssignmentBonusSe>(ref bonus) && args.Card is ModAssignCard)
			{
				<>n__0();
				((StatusEffect)bonus).NotifyActivating();
				yield return (BattleAction)new DrawManyCardAction(((StatusEffect)this).Level);
				yield return bonus.ConsumeBuff();
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class AssignPlayGainBlockSeDef : ModStatusEffectTemplate
	{
		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("AssignPlayGainBlockSe");
		}
	}
	[EntityLogic(typeof(AssignPlayGainBlockSeDef))]
	public sealed class AssignPlayGainBlockSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
		}

		private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
		{
			if (args.Card is ModAssignCard || args.Card is AssignmentOrder)
			{
				yield return (BattleAction)new CastBlockShieldAction((Unit)(object)((StatusEffect)this).Battle.Player, ((StatusEffect)this).Level, 0, (BlockShieldType)1, true);
			}
		}
	}
	public sealed class AssignSeparationSeDef : ModStatusEffectTemplate
	{
		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("AssignSeparationSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasLevel = false;
			return val;
		}
	}
	[EntityLogic(typeof(AssignSeparationSeDef))]
	public sealed class AssignSeparationSe : StatusEffect
	{
		public int AssignmentBonusGain => 1;

		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<AssignTriggerEventArgs>(ModGameEvents.AssignEffectTriggered, (EventSequencedReactor<AssignTriggerEventArgs>)OnAssignTriggered);
		}

		private IEnumerable<BattleAction> OnAssignTriggered(AssignTriggerEventArgs args)
		{
			if (((Unit)((StatusEffect)this).Battle.Player).StatusEffects.Where((StatusEffect se) => ((object)se).GetType() == ((object)args.TriggeredEffect).GetType()).Count() > 1)
			{
				yield return ((StatusEffect)this).BuffAction<AssignmentBonusSe>(AssignmentBonusGain, 0, 0, 0, 0.2f);
			}
		}
	}
	public sealed class AssignTriggerSummonSeDef : ModStatusEffectTemplate
	{
		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("AssignTriggerSummonSe");
		}
	}
	[EntityLogic(typeof(AssignTriggerSummonSeDef))]
	public sealed class AssignTriggerSummonSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<AssignTriggerEventArgs>(ModGameEvents.AssignEffectTriggered, (EventSequencedReactor<AssignTriggerEventArgs>)OnAssignTriggered);
		}

		private IEnumerable<BattleAction> OnAssignTriggered(AssignTriggerEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd)
			{
				IEnumerable<Type> possibleSummons = HaniwaFrontlineUtils.GetAllSummonTypes(((StatusEffect)this).Battle);
				List<Card> cards = new List<Card>();
				for (int i = 0; i < ((StatusEffect)this).Level; i++)
				{
					Card randomCard = Library.CreateCard(CollectionsExtensions.Sample<Type>(possibleSummons, ((GameEntity)this).GameRun.BattleRng));
					cards.Add(randomCard);
				}
				if (cards.Count > 0)
				{
					<>n__0();
					yield return (BattleAction)new AddCardsToHandAction((IEnumerable<Card>)cards, (AddCardsType)0);
				}
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class AssignTriggerUpgradeSeDef : ModStatusEffectTemplate
	{
		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("AssignTriggerUpgradeSe");
		}
	}
	[EntityLogic(typeof(AssignTriggerUpgradeSeDef))]
	public sealed class AssignTriggerUpgradeSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<AssignTriggerEventArgs>(ModGameEvents.AssignEffectTriggered, (EventSequencedReactor<AssignTriggerEventArgs>)OnAssignTriggered);
		}

		private IEnumerable<BattleAction> OnAssignTriggered(AssignTriggerEventArgs args)
		{
			<>n__0();
			yield return (BattleAction)new UpgradeCardsAction((IEnumerable<Card>)CollectionsExtensions.SampleManyOrAll<Card>(((StatusEffect)this).Battle.HandZone.Where((Card c) => c.CanUpgradeAndPositive), ((StatusEffect)this).Level, ((GameEntity)this).GameRun.BattleRng));
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class AutoCreateReservesSeDef : ModStatusEffectTemplate
	{
		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("AutoCreateReservesSe");
		}
	}
	[EntityLogic(typeof(AutoCreateReservesSeDef))]
	public sealed class AutoCreateReservesSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnStarted, (EventSequencedReactor<UnitEventArgs>)OnTurnStarted);
		}

		private IEnumerable<BattleAction> OnTurnStarted(UnitEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd)
			{
				int count = ((StatusEffect)this).Battle.HandZone.OfType<CreateHaniwa>().Count();
				if (count < ((StatusEffect)this).Level)
				{
					<>n__0();
					yield return (BattleAction)new AddCardsToHandAction((IEnumerable<Card>)Library.CreateCards<CreateHaniwa>(((StatusEffect)this).Level - count, false), (AddCardsType)0);
				}
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class CavalryWorshippingSeDef : ModStatusEffectTemplate
	{
		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("CavalryWorshippingSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasCount = true;
			return val;
		}
	}
	[EntityLogic(typeof(CavalryWorshippingSeDef))]
	public sealed class CavalryWorshippingSe : StatusEffect
	{
		public int Threshold => 5;

		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<GainHaniwaEventArgs>(ModGameEvents.GainedHaniwa, (EventSequencedReactor<GainHaniwaEventArgs>)OnGainedHaniwa);
		}

		private IEnumerable<BattleAction> OnGainedHaniwa(GainHaniwaEventArgs args)
		{
			if (args.CavalryToGain > 0)
			{
				((StatusEffect)this).Count = ((StatusEffect)this).Count + args.CavalryToGain;
				int timesToActivate = ((StatusEffect)this).Count / Threshold;
				if (((StatusEffect)this).Count >= Threshold)
				{
					((StatusEffect)this).Count = ((StatusEffect)this).Count - Threshold * timesToActivate;
				}
				if (timesToActivate > 0)
				{
					<>n__0();
					yield return ((StatusEffect)this).BuffAction<Graze>(timesToActivate * ((StatusEffect)this).Level, 0, 0, 0, 0.2f);
				}
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class ChainOfCommandSeDef : ModStatusEffectTemplate
	{
		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("ChainOfCommandSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasLevel = false;
			return val;
		}
	}
	[EntityLogic(typeof(ChainOfCommandSeDef))]
	public sealed class ChainOfCommandSe : StatusEffect
	{
	}
	public sealed class ClayToAshesSeDef : ModStatusEffectTemplate
	{
		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("ClayToAshesSe");
		}
	}
	[EntityLogic(typeof(ClayToAshesSeDef))]
	public sealed class ClayToAshesSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<LoseHaniwaEventArgs>(ModGameEvents.SacrificedHaniwa, (EventSequencedReactor<LoseHaniwaEventArgs>)OnHaniwaSacrificed);
			((StatusEffect)this).ReactOwnerEvent<CardEventArgs>(((StatusEffect)this).Battle.CardExiled, (EventSequencedReactor<CardEventArgs>)OnCardExiled);
		}

		private IEnumerable<BattleAction> OnCardExiled(CardEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd && args.Card is ModFrontlineCard)
			{
				<>n__0();
				yield return (BattleAction)new CastBlockShieldAction(((StatusEffect)this).Owner, new ShieldInfo(((StatusEffect)this).Level, (BlockShieldType)1), true);
				yield return ((StatusEffect)this).BuffAction<LoyaltyProtectionSe>(((StatusEffect)this).Level, 0, 0, 0, 0.2f);
			}
		}

		private IEnumerable<BattleAction> OnHaniwaSacrificed(LoseHaniwaEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd)
			{
				<>n__0();
				yield return (BattleAction)new CastBlockShieldAction(((StatusEffect)this).Owner, new ShieldInfo(((StatusEffect)this).Level, (BlockShieldType)1), true);
				yield return ((StatusEffect)this).BuffAction<LoyaltyProtectionSe>(((StatusEffect)this).Level, 0, 0, 0, 0.2f);
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class EnhancedTrainingSeDef : ModStatusEffectTemplate
	{
		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("EnhancedTrainingSe");
		}
	}
	[EntityLogic(typeof(EnhancedTrainingSeDef))]
	public sealed class EnhancedTrainingSe : StatusEffect
	{
	}
	public sealed class FencerWorshippingSeDef : ModStatusEffectTemplate
	{
		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("FencerWorshippingSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasCount = true;
			return val;
		}
	}
	[EntityLogic(typeof(FencerWorshippingSeDef))]
	public sealed class FencerWorshippingSe : StatusEffect
	{
		public int Threshold => 5;

		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<GainHaniwaEventArgs>(ModGameEvents.GainedHaniwa, (EventSequencedReactor<GainHaniwaEventArgs>)OnGainedHaniwa);
		}

		private IEnumerable<BattleAction> OnGainedHaniwa(GainHaniwaEventArgs args)
		{
			if (args.FencerToGain > 0)
			{
				((StatusEffect)this).Count = ((StatusEffect)this).Count + args.FencerToGain;
				int timesToActivate = ((StatusEffect)this).Count / Threshold;
				if (((StatusEffect)this).Count >= Threshold)
				{
					((StatusEffect)this).Count = ((StatusEffect)this).Count - Threshold * timesToActivate;
				}
				if (timesToActivate > 0)
				{
					<>n__0();
					yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)((StatusEffect)this).Battle.RandomAliveEnemy, DamageInfo.Reaction((float)(timesToActivate * ((StatusEffect)this).Level), false), "Instant", (GunType)0);
				}
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class FrontlineDoubleActionSeDef : ModStatusEffectTemplate
	{
		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("FrontlineDoubleActionSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasLevel = false;
			return val;
		}
	}
	[EntityLogic(typeof(FrontlineDoubleActionSeDef))]
	public sealed class FrontlineDoubleActionSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
		}

		private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd && ((int)args.Selector.Type != 1 || !((Unit)args.Selector.SelectedEnemy).IsDead))
			{
				Card card = args.Card;
				if (card is ModFrontlineCard frontlineCard)
				{
					<>n__0();
					yield return (BattleAction)(object)new CommandAction(new List<Card> { (Card)(object)frontlineCard }, args.Selector, shouldConsumeLoyalty: true);
				}
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class HaniwasNeverDieSeDef : ModStatusEffectTemplate
	{
		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("HaniwasNeverDieSe");
		}
	}
	[EntityLogic(typeof(HaniwasNeverDieSeDef))]
	public sealed class HaniwasNeverDieSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<LoseHaniwaEventArgs>(ModGameEvents.SacrificedHaniwa, (EventSequencedReactor<LoseHaniwaEventArgs>)OnSacrificedHaniwa);
		}

		private IEnumerable<BattleAction> OnSacrificedHaniwa(LoseHaniwaEventArgs args)
		{
			foreach (BattleAction randomAssignBuff in HaniwaAssignUtils.GetRandomAssignBuffs(fencerCount: Math.Min(args.FencerToLose, ((StatusEffect)this).Level), archerCount: Math.Min(args.ArcherToLose, ((StatusEffect)this).Level), cavalryCount: Math.Min(args.CavalryToLose, ((StatusEffect)this).Level), battle: ((StatusEffect)this).Battle, manualStack: false))
			{
				yield return randomAssignBuff;
			}
		}
	}
	public sealed class LeadThroughExampleSeDef : ModStatusEffectTemplate
	{
		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("LeadThroughExampleSe");
		}
	}
	[EntityLogic(typeof(LeadThroughExampleSeDef))]
	public sealed class LeadThroughExampleSe : StatusEffect
	{
		public int LoyaltyProtectionGain => 5 * ((StatusEffect)this).Level;

		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<AssignTriggerEventArgs>(ModGameEvents.AssignEffectTriggered, (EventSequencedReactor<AssignTriggerEventArgs>)OnAssignEffectTriggered);
			((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
		}

		private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
		{
			if (args.Card is ModFrontlineCard)
			{
				yield return ((StatusEffect)this).BuffAction<AssignmentBonusSe>(((StatusEffect)this).Level, 0, 0, 0, 0.2f);
			}
		}

		private IEnumerable<BattleAction> OnAssignEffectTriggered(AssignTriggerEventArgs args)
		{
			yield return ((StatusEffect)this).BuffAction<LoyaltyProtectionSe>(LoyaltyProtectionGain, 0, 0, 0, 0.2f);
		}
	}
	public sealed class MaxHaniwaUpSeDef : ModStatusEffectTemplate
	{
		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("MaxHaniwaUpSe");
		}
	}
	[EntityLogic(typeof(MaxHaniwaUpSeDef))]
	public sealed class MaxHaniwaUpSe : StatusEffect
	{
	}
	public sealed class WatchtowerDef : ModStatusEffectTemplate
	{
		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("Watchtower");
		}
	}
	[EntityLogic(typeof(WatchtowerDef))]
	public sealed class Watchtower : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
		}

		private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd && (int)args.Card.CardType == 1)
			{
				<>n__0();
				yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)((StatusEffect)this).Battle.RandomAliveEnemy, DamageInfo.Reaction((float)((StatusEffect)this).Level, false), "Instant", (GunType)0);
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class ZeroCostReductionSeDef : ModStatusEffectTemplate
	{
		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("ZeroCostReductionSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasCount = true;
			return val;
		}
	}
	[EntityLogic(typeof(ZeroCostReductionSeDef))]
	public sealed class ZeroCostReductionSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).HandleOwnerEvent<CardUsingEventArgs>(((StatusEffect)this).Battle.CardUsed, (GameEventHandler<CardUsingEventArgs>)OnCardUsed);
			((StatusEffect)this).HandleOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnStarted, (GameEventHandler<UnitEventArgs>)OnTurnStarted);
		}

		public override bool Stack(StatusEffect other)
		{
			((StatusEffect)this).Stack(other);
			((StatusEffect)this).Count = ((StatusEffect)this).Count + other.Level;
			return true;
		}

		private void OnTurnStarted(UnitEventArgs args)
		{
			((StatusEffect)this).Count = ((StatusEffect)this).Level;
		}

		private void OnCardUsed(CardUsingEventArgs args)
		{
			//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_0094: Unknown result type (might be due to invalid IL or missing references)
			if (((StatusEffect)this).Battle.BattleShouldEnd || ((StatusEffect)this).Count <= 0)
			{
				return;
			}
			ManaGroup consumingMana = args.ConsumingMana;
			if (((ManaGroup)(ref consumingMana)).IsEmpty)
			{
				Card val = CollectionsExtensions.SampleOrDefault<Card>(((StatusEffect)this).Battle.HandZone.Where(delegate(Card c)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0006: Unknown result type (might be due to invalid IL or missing references)
					ManaGroup cost = c.Cost;
					return ((ManaGroup)(ref cost)).Any > 0 && !c.IsForbidden;
				}), ((GameEntity)this).GameRun.BattleRng);
				if (val != null)
				{
					((StatusEffect)this).NotifyActivating();
					val.DecreaseTurnCost(ManaGroup.Anys(1));
					int count = ((StatusEffect)this).Count;
					((StatusEffect)this).Count = count - 1;
				}
			}
		}
	}
	public sealed class CommandersMarkSeDef : ModStatusEffectTemplate
	{
		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("CommandersMarkSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.Type = (StatusEffectType)1;
			val.HasLevel = false;
			val.IsStackable = false;
			return val;
		}
	}
	[EntityLogic(typeof(CommandersMarkSeDef))]
	public sealed class CommandersMarkSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			foreach (EnemyUnit allAliveEnemy in ((StatusEffect)this).Battle.AllAliveEnemies)
			{
				((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(((Unit)allAliveEnemy).StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnEnemyStatusAdded);
			}
			((StatusEffect)this).HandleOwnerEvent<UnitEventArgs>(((StatusEffect)this).Battle.EnemySpawned, (GameEventHandler<UnitEventArgs>)OnEnemySpawned);
		}

		private void OnEnemySpawned(UnitEventArgs args)
		{
			((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(args.Unit.StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnEnemyStatusAdded);
		}

		private IEnumerable<BattleAction> OnEnemyStatusAdded(StatusEffectApplyEventArgs args)
		{
			if (args.Effect != this && args.Effect is CommandersMarkSe)
			{
				yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
			}
		}
	}
	public sealed class AssignmentBonusSeDef : ModStatusEffectTemplate
	{
		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("AssignmentBonusSe");
		}
	}
	[EntityLogic(typeof(AssignmentBonusSeDef))]
	public sealed class AssignmentBonusSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<AssignTriggerEventArgs>(ModGameEvents.AssignEffectTriggered, (EventSequencedReactor<AssignTriggerEventArgs>)OnAssignTriggered);
		}

		private IEnumerable<BattleAction> OnAssignTriggered(AssignTriggerEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd && !args.OnTurnStart && ((StatusEffect)this).Battle.HandZone.Count != ((StatusEffect)this).Battle.MaxHand)
			{
				<>n__0();
				yield return (BattleAction)new DrawCardAction();
				yield return ConsumeBuff();
			}
		}

		public BattleAction ConsumeBuff()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			if (((StatusEffect)this).Level <= 1)
			{
				return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
			}
			int level = ((StatusEffect)this).Level;
			((StatusEffect)this).Level = level - 1;
			return null;
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	public sealed class AssignDoubleTriggerSeDef : ModStatusEffectTemplate
	{
		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("AssignDoubleTriggerSe");
		}
	}
	[EntityLogic(typeof(AssignDoubleTriggerSeDef))]
	public sealed class AssignDoubleTriggerSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<AssignTriggerEventArgs>(ModGameEvents.AssignEffectTriggered, (EventSequencedReactor<AssignTriggerEventArgs>)OnAssignTriggered);
		}

		private IEnumerable<BattleAction> OnAssignTriggered(AssignTriggerEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd)
			{
				yield return (BattleAction)(object)new AssignTriggerAction(args.TriggeredEffect, args.OnTurnStart, createTriggeredEvent: false);
				if (((StatusEffect)this).Level > 1)
				{
					int level = ((StatusEffect)this).Level;
					((StatusEffect)this).Level = level - 1;
				}
				else
				{
					yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
				}
			}
		}
	}
	public sealed class AssignReverseTickdownSeDef : ModStatusEffectTemplate
	{
		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("AssignReverseTickdownSe");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasLevel = false;
			return val;
		}
	}
	[EntityLogic(typeof(AssignReverseTickdownSeDef))]
	public sealed class AssignReverseTickdownSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnEnded, (EventSequencedReactor<UnitEventArgs>)OnPlayerTurnEnded);
		}

		private IEnumerable<BattleAction> OnPlayerTurnEnded(UnitEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd)
			{
				int totalCounts = ((Unit)((StatusEffect)this).Battle.Player).StatusEffects.Where((StatusEffect s) => s is ModAssignStatusEffect).Sum((StatusEffect s) => s.Count);
				yield return (BattleAction)new CastBlockShieldAction((Unit)(object)((StatusEffect)this).Battle.Player, totalCounts, 0, (BlockShieldType)1, true);
				yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
			}
		}
	}
	public sealed class IllnessPreventionSeDef : ModStatusEffectTemplate
	{
		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("IllnessPreventionSe");
		}
	}
	[EntityLogic(typeof(IllnessPreventionSeDef))]
	public sealed class IllnessPreventionSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(((Unit)((StatusEffect)this).Battle.Player).StatusEffectAdding, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnPlayerStatusEffectAdding);
		}

		private IEnumerable<BattleAction> OnPlayerStatusEffectAdding(StatusEffectApplyEventArgs args)
		{
			if (((StatusEffect)this).Battle.BattleShouldEnd || (int)args.Effect.Type != 1)
			{
				yield break;
			}
			((GameEventArgs)args).AddModifier((GameEntity)(object)this);
			if (args.Effect.HasLevel)
			{
				<>n__0();
				if (((StatusEffect)this).Level > args.Effect.Level)
				{
					((StatusEffect)this).Level = ((StatusEffect)this).Level - args.Effect.Level;
					((GameEventArgs)args).CancelBy((GameEntity)(object)this);
					yield break;
				}
				if (((StatusEffect)this).Level == args.Effect.Level)
				{
					((GameEventArgs)args).CancelBy((GameEntity)(object)this);
				}
				else
				{
					args.Level -= ((StatusEffect)this).Level;
					StatusEffect effect = args.Effect;
					effect.Level -= ((StatusEffect)this).Level;
				}
				yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
			}
			else
			{
				if (!args.Eff