Decompiled source of CrampsMayumiMod v0.2.1

LBoLMod.dll

Decompiled 2 weeks 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.StatusEffects;
using LBoL.Core.Units;
using LBoL.EntityLib.Cards;
using LBoL.EntityLib.Exhibits;
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 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.UltimateSkills;
using LBoLMod.Utils;
using TMPro;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.UI;

[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+bbc20bd30344714733afab5918001821f7b2857f")]
[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.2.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInProcess("LBoL.exe")]
	public class BepinexPlugin : BaseUnityPlugin
	{
		private static readonly Harmony harmony = PInfo.harmony;

		internal static ManualLogSource log;

		internal static TemplateSequenceTable sequenceTable = new TemplateSequenceTable(0);

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

		internal static DirectorySource directorySource = new DirectorySource("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.2.1";

		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;
				if (((ManaGroup)(ref baseMana)).HasColor((ManaColor)2))
				{
					return CollectionExtensions.AddItem<Type>((IEnumerable<Type>)OnColorAssignCardTypes, typeof(ArcherPrepFrostArrow)).ToList();
				}
			}
			return OnColorAssignCardTypes;
		}

		public static List<Card> CreateAssignOptionCards(PlayerUnit player, bool includePaused = true, bool includePermanent = true)
		{
			List<Card> list = new List<Card>();
			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;
				bool flag = true;
				if (!includePaused && item.IsPaused)
				{
					flag = false;
				}
				if (!includePermanent && item.IsPermanent)
				{
					flag = false;
				}
				if (flag)
				{
					list.Add((Card)(object)modAssignOptionCard);
				}
			}
			return list;
		}
	}
	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)
		};

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

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

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

		public static List<Card> GetCommonCards(BattleController battle, int numberToSpawn = 1, bool checkSacrificeRequirement = false)
		{
			return GetOptionCards(CommonOptionTypes, battle, numberToSpawn, checkSacrificeRequirement);
		}

		public static List<Card> GetUncommonCards(BattleController battle, int numberToSpawn = 1, bool checkSacrificeRequirement = false)
		{
			return GetOptionCards(UncommonOptionTypes, battle, numberToSpawn, checkSacrificeRequirement);
		}

		public static List<Card> GetAllCards(BattleController battle, int numberToSpawn = 1, bool checkSacrificeRequirement = false)
		{
			return GetOptionCards(AllOptionTypes, battle, numberToSpawn, checkSacrificeRequirement);
		}

		private static List<Card> GetOptionCards(List<Type> types, BattleController battle, int numberToSpawn = 1, bool checkSacrificeRequirement = false)
		{
			List<Card> list = new List<Card>();
			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((Card)(object)modFrontlineOptionCard);
					}
				}
				else
				{
					list.Add((Card)(object)modFrontlineOptionCard);
				}
			}
			return list;
		}

		public static IEnumerable<BattleAction> CardsSummon(IReadOnlyList<Card> modFrontlineCards, int startingUpgrades = 0)
		{
			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;
				if (startingUpgrades > 0)
				{
					List<Card> cards = optionCard.GetCardsToSpawn();
					cards.ForEach(delegate(Card c)
					{
						c.UpgradeCounter = startingUpgrades;
					});
					cardsToSpawn.AddRange(cards);
				}
				else
				{
					cardsToSpawn.AddRange(optionCard.GetCardsToSpawn());
				}
			}
			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 class HaniwaUtils
	{
		public static bool DoesPlayerHavePreservedHaniwa(PlayerUnit player)
		{
			if (((Unit)player).HasStatusEffect<ArcherHaniwa>())
			{
				ArcherHaniwa statusEffect = ((Unit)player).GetStatusEffect<ArcherHaniwa>();
				if (statusEffect.Preserved)
				{
					return true;
				}
			}
			if (((Unit)player).HasStatusEffect<CavalryHaniwa>())
			{
				CavalryHaniwa statusEffect2 = ((Unit)player).GetStatusEffect<CavalryHaniwa>();
				if (statusEffect2.Preserved)
				{
					return true;
				}
			}
			if (((Unit)player).HasStatusEffect<FencerHaniwa>())
			{
				FencerHaniwa statusEffect3 = ((Unit)player).GetStatusEffect<FencerHaniwa>();
				if (statusEffect3.Preserved)
				{
					return true;
				}
			}
			return false;
		}

		public static void PreserveAllCurrentHaniwa(PlayerUnit player)
		{
			PreserveSpecifiedHaniwa<ArcherHaniwa>(player);
			PreserveSpecifiedHaniwa<CavalryHaniwa>(player);
			PreserveSpecifiedHaniwa<FencerHaniwa>(player);
		}

		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 void PreserveOldestHaniwa(PlayerUnit player)
		{
			List<ModHaniwaStatusEffect> allHaniwa = GetAllHaniwa(player);
			if (allHaniwa.Count <= 0)
			{
				return;
			}
			int oldestAge = allHaniwa.Where((ModHaniwaStatusEffect s) => !s.Preserved).Max((ModHaniwaStatusEffect s) => s.AgeCounter);
			foreach (ModHaniwaStatusEffect item in allHaniwa.Where((ModHaniwaStatusEffect s) => s.AgeCounter == oldestAge))
			{
				item.Preserved = true;
			}
		}

		public static void PreserveSpecifiedHaniwa<T>(PlayerUnit player) where T : ModHaniwaStatusEffect
		{
			if (((Unit)player).HasStatusEffect<T>())
			{
				T statusEffect = ((Unit)player).GetStatusEffect<T>();
				if (!statusEffect.Preserved)
				{
					statusEffect.Preserved = true;
				}
			}
		}

		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;
		}
	}
}
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 PlayerDef()).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("dummyicon.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;
			return val;
		}
	}
}
namespace LBoLMod.UltimateSkills
{
	public sealed class UltimateSkillADef : 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("UltimateSkillA");
		}

		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(UltimateSkillADef))]
	public sealed class UltimateSkillA : UltimateSkill
	{
		public UltimateSkillA()
		{
			((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 UltimateSkillBDef : 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("UltimateSkillB");
		}

		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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			return new UltimateSkillConfig("", 10, 100, 100, 2, (UsRepeatableType)1, 40, 5, 0, (Keyword)256, (IReadOnlyList<string>)new List<string> { "Haniwa" }, (IReadOnlyList<string>)new List<string>());
		}
	}
	[EntityLogic(typeof(UltimateSkillBDef))]
	public sealed class UltimateSkillB : UltimateSkill
	{
		public UltimateSkillB()
		{
			((UltimateSkill)this).TargetType = (TargetType)1;
		}

		protected override IEnumerable<BattleAction> Actions(UnitSelector selector)
		{
			_ = ((UltimateSkill)this).Battle.Player;
			yield return (BattleAction)(object)new GainHaniwaAction(((UltimateSkill)this).Value1, ((UltimateSkill)this).Value1, ((UltimateSkill)this).Value1);
			yield return (BattleAction)new DamageAction((Unit)(object)((UltimateSkill)this).Owner, (Unit)(object)selector.GetEnemy(((UltimateSkill)this).Battle), ((UltimateSkill)this).Damage, "Instant", (GunType)0);
		}
	}
}
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
	{
		private bool JustApplied { get; set; } = true;


		protected ModAssignCard AssignSourceCard { get; set; }

		public int CardFencerAssigned => AssignSourceCard.FencerAssigned;

		public int CardArcherAssigned => AssignSourceCard.ArcherAssigned;

		public int CardCavalryAssigned => AssignSourceCard.CavalryAssigned;

		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 IsPaused { get; set; } = false;


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


		protected override void OnAdded(Unit unit)
		{
			if (((StatusEffect)this).SourceCard is ModAssignCard assignSourceCard)
			{
				AssignSourceCard = assignSourceCard;
			}
			((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 (((Unit)((StatusEffect)this).Battle.Player).HasStatusEffect<AssignReverseTickdownSe>())
			{
				((StatusEffect)this).Config.CountStackType = (StackType)1;
			}
			((StatusEffect)this).Stack(other);
			if (((Unit)((StatusEffect)this).Battle.Player).HasStatusEffect<AssignReverseTickdownSe>())
			{
				((StatusEffect)this).Config.CountStackType = (StackType)2;
			}
			if (!((StatusEffect)this).SourceCard.IsUpgraded && other.SourceCard.IsUpgraded && other.SourceCard is ModAssignCard assignSourceCard)
			{
				AssignSourceCard = assignSourceCard;
			}
			if (IsPermanent)
			{
				((StatusEffect)this).Level = 1;
				Tickdown(3);
			}
			return true;
		}

		public void MakePermanent()
		{
			IsPermanent = true;
			((StatusEffect)this).Level = 1;
		}

		public void IncreaseExtraTrigger(int amount)
		{
			if (IsPermanent)
			{
				Tickdown(3);
			}
			else
			{
				((StatusEffect)this).Level = ((StatusEffect)this).Level + amount;
			}
		}

		public void Tickdown(int amount)
		{
			if (!IsPaused)
			{
				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);
		}

		public IEnumerable<BattleAction> DuplicateTrigger()
		{
			return AssignTriggering(onTurnStart: false, shouldRemove: false);
		}

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

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

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

		private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
		{
			if (!JustApplied)
			{
				Tickdown(1);
			}
			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();
			if (IsPermanent)
			{
				((StatusEffect)this).Level = 1;
			}
			yield return (BattleAction)(object)new AssignTriggerAction(OnAssignmentDone(onTurnStart), BeforeAssignmentDone(onTurnStart), AfterAssignmentDone(onTurnStart), ((StatusEffect)this).Level, onTurnStart);
			if (((StatusEffect)this).Battle.BattleShouldEnd)
			{
				yield break;
			}
			if (IsPermanent)
			{
				((StatusEffect)this).Count = StartingCardCounter;
				if (HaniwaUtils.IsLevelFulfilled(((StatusEffect)this).Battle.Player, HaniwaActionType.Require, CardFencerAssigned, CardArcherAssigned, CardCavalryAssigned))
				{
					yield return (BattleAction)(object)new LoseHaniwaAction(HaniwaActionType.Require, CardFencerAssigned, CardArcherAssigned, CardCavalryAssigned);
				}
				else
				{
					yield return (BattleAction)new DamageAction((Unit)(object)((StatusEffect)this).Battle.Player, (Unit)(object)((StatusEffect)this).Battle.Player, DamageInfo.HpLose(1f, false), "Instant", (GunType)0);
				}
			}
			else if (shouldRemove)
			{
				yield return (BattleAction)(object)new GainHaniwaAction(CardFencerAssigned, CardArcherAssigned, CardCavalryAssigned, isFromAssign: true);
				yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
			}
		}

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

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

		protected virtual IEnumerable<BattleAction> AfterAssignmentDone(bool onTurnStart)
		{
			return new List<BattleAction>();
		}
	}
	public abstract class ModAssignStatusEffectTemplate : ModStatusEffectTemplate
	{
		public override Sprite LoadSprite()
		{
			return ResourceLoader.LoadSprite("assignicon.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
		}

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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)2, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
		}
	}
	public abstract class ModHaniwaStatusEffect : StatusEffect
	{
		protected bool preserved = false;

		protected int ageCounter = 0;

		public bool Preserved
		{
			get
			{
				return preserved;
			}
			set
			{
				preserved = value;
				((StatusEffect)this).NotifyActivating();
				((GameEntity)this).NotifyChanged();
			}
		}

		public int AgeCounter => ageCounter;

		private int MaxLevel => 10;

		protected override void OnAdding(Unit unit)
		{
			if (((StatusEffect)this).Level > MaxLevel)
			{
				((StatusEffect)this).Level = MaxLevel;
			}
			((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnStarted, (EventSequencedReactor<UnitEventArgs>)onPlayerTurnStart);
			((StatusEffect)this).ReactOwnerEvent<StatusEffectApplyEventArgs>(((Unit)((StatusEffect)this).Battle.Player).StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)onStatusApplied);
		}

		private IEnumerable<BattleAction> onStatusApplied(StatusEffectApplyEventArgs args)
		{
			if (args.Effect is ModHaniwaStatusEffect)
			{
				ageCounter++;
			}
			yield break;
		}

		private IEnumerable<BattleAction> onPlayerTurnStart(UnitEventArgs args)
		{
			if (Preserved)
			{
				<>n__0();
				preserved = false;
			}
			yield break;
		}

		public override bool Stack(StatusEffect other)
		{
			((StatusEffect)this).Stack(other);
			if (((StatusEffect)this).Level > MaxLevel)
			{
				((StatusEffect)this).Level = MaxLevel;
			}
			return true;
		}

		public BattleAction TickdownOrRemove()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			if (Preserved)
			{
				return null;
			}
			if (((StatusEffect)this).Level > 1)
			{
				((StatusEffect)this).Level = ((StatusEffect)this).Level - 1;
				return null;
			}
			return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyChanged();
		}
	}
	public abstract class ModStatusEffectTemplate : StatusEffectTemplate
	{
		public override LocalizationOption LoadLocalization()
		{
			return (LocalizationOption)(object)BepinexPlugin.StatusEffectsBatchLoc.AddEntity((EntityDefinition)(object)this);
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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>(), "Default", "Default", "Default");
		}
	}
}
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");
		}
	}
	[EntityLogic(typeof(AssignDef))]
	public sealed class Assign : 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");
		}
	}
	[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 PauseDef : 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("Pause");
		}
	}
	[EntityLogic(typeof(PauseDef))]
	public sealed class Pause : 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
	{
	}
}
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
	{
		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			DamageInfo cardDamage = base.CardDamage;
			DamageInfo accurateDmg = DamageInfo.Attack(((DamageInfo)(ref cardDamage)).Damage, true);
			yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (IEnumerable<Unit>)((StatusEffect)this).Battle.AllAliveEnemies, accurateDmg, "Instant", (GunType)0);
			foreach (BattleAction item in ((StatusEffect)this).DebuffAction<Vulnerable>((IEnumerable<Unit>)((StatusEffect)this).Battle.AllAliveEnemies, 0, base.CardValue1, 0, 0, true, 0.2f))
			{
				yield return item;
			}
		}
	}
	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
	{
		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);
			}
		}

		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			EnemyUnit target = ((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
	{
		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			for (int i = 0; i < ((Card)base.AssignSourceCard).Value1; i++)
			{
				yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)((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
	{
		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			yield break;
		}

		protected override IEnumerable<BattleAction> AfterAssignmentDone(bool onTurnStart)
		{
			yield return (BattleAction)(object)new ApplyStatusEffectAction<Watchtower>(((StatusEffect)this).Owner, (int?)(base.CardValue1 + (((StatusEffect)this).Level - 1) * (base.CardValue1 / 2)), (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
	{
		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			yield return (BattleAction)new DamageAction(((StatusEffect)this).Owner, (Unit)(object)((StatusEffect)this).Battle.LowestHpEnemy, ((Card)base.AssignSourceCard).Damage, "Instant", (GunType)0);
		}

		protected override IEnumerable<BattleAction> AfterAssignmentDone(bool onTurnStart)
		{
			if (!onTurnStart)
			{
				yield return (BattleAction)new GainManaAction(base.CardMana);
			}
		}
	}
	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
	{
		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			yield return (BattleAction)new DrawManyCardAction(base.CardValue1);
		}

		protected override IEnumerable<BattleAction> BeforeAssignmentDone(bool onTurnStart)
		{
			ScryInfo cardScry = base.CardScry;
			int num = ((StatusEffect)this).Level - 1;
			ScryInfo cardScry2 = base.CardScry;
			yield return (BattleAction)new ScryAction(((ScryInfo)(ref cardScry)).IncreasedBy(num * ((ScryInfo)(ref cardScry2)).Count));
		}
	}
	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 ManaGroup RedMana => ManaGroup.Reds(base.CardValue2);

		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			yield return (BattleAction)new GainManaAction(RedMana);
		}

		protected override IEnumerable<BattleAction> AfterAssignmentDone(bool onTurnStart)
		{
			yield return (BattleAction)new GainManaAction(base.CardMana);
		}
	}
	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)).IncreaseBy(ChargeDamage);
			}
		}

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


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

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

		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			Unit owner = ((StatusEffect)this).Owner;
			EnemyUnit highestHpEnemy = ((StatusEffect)this).Battle.HighestHpEnemy;
			DamageInfo cardDamage = base.CardDamage;
			yield return (BattleAction)new DamageAction(owner, (Unit)(object)highestHpEnemy, ((DamageInfo)(ref cardDamage)).IncreaseBy(ChargeDamage), "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
	{
		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			yield return (BattleAction)new CastBlockShieldAction((Unit)(object)((StatusEffect)this).Battle.Player, (Unit)(object)((StatusEffect)this).Battle.Player, ((Card)base.AssignSourceCard).Shield, 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
	{
		protected override IEnumerable<BattleAction> OnAssignmentDone(bool onTurnStart)
		{
			_ = ((StatusEffect)this).Battle.Player;
			yield return ((StatusEffect)this).BuffAction<Reflect>(base.CardValue2, 0, 0, 0, 0.2f);
		}

		protected override IEnumerable<BattleAction> AfterAssignmentDone(bool onTurnStart)
		{
			PlayerUnit player = ((StatusEffect)this).Battle.Player;
			yield return ((StatusEffect)this).BuffAction<Reflect>(((Unit)player).Block + ((Unit)player).Shield, 0, 0, 0, 0.2f);
		}
	}
}
namespace LBoLMod.StatusEffects.Abilities
{
	public sealed class AssignCostTriggerSeDef : 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("AssignCostTriggerSe");
		}
	}
	[EntityLogic(typeof(AssignCostTriggerSeDef))]
	public sealed class AssignCostTriggerSe : StatusEffect
	{
		public ManaGroup IncreasedCost => ManaGroup.Anys(((StatusEffect)this).Level);

		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).HandleOwnerEvent<StatusEffectApplyEventArgs>(((Unit)((StatusEffect)this).Battle.Player).StatusEffectAdding, (GameEventHandler<StatusEffectApplyEventArgs>)OnStatusEffectAdding);
		}

		private void OnStatusEffectAdding(StatusEffectApplyEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd && args.Effect is ModAssignStatusEffect modAssignStatusEffect)
			{
				((StatusEffect)modAssignStatusEffect).Level = ((StatusEffect)modAssignStatusEffect).Level + ((StatusEffect)this).Level;
			}
		}
	}
	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");
		}

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasLevel = false;
			return val;
		}
	}
	[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)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd && args.Card is ModAssignCard)
			{
				<>n__0();
				yield return (BattleAction)new DrawCardAction();
			}
		}

		[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)
			{
				yield return (BattleAction)new CastBlockShieldAction((Unit)(object)((StatusEffect)this).Battle.Player, ((StatusEffect)this).Level, 0, (BlockShieldType)1, true);
			}
		}
	}
	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.AllSummonTypes;
				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 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 ((StatusEffect)this).BuffAction<TempFirepower>(((StatusEffect)this).Level, 0, 0, 0, 0.2f);
			}
		}

		private IEnumerable<BattleAction> OnHaniwaSacrificed(LoseHaniwaEventArgs args)
		{
			if (!((StatusEffect)this).Battle.BattleShouldEnd)
			{
				<>n__0();
				yield return ((StatusEffect)this).BuffAction<TempFirepower>(((StatusEffect)this).Level, 0, 0, 0, 0.2f);
			}
		}

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

		public override StatusEffectConfig MakeConfig()
		{
			StatusEffectConfig val = base.MakeConfig();
			val.HasLevel = false;
			return val;
		}
	}
	[EntityLogic(typeof(ExileFrontlineBlitzSeDef))]
	public sealed class ExileFrontlineBlitzSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).ReactOwnerEvent<CardEventArgs>(((StatusEffect)this).Battle.CardExiled, (EventSequencedReactor<CardEventArgs>)OnCardExiled);
		}

		private IEnumerable<BattleAction> OnCardExiled(CardEventArgs args)
		{
			if (((StatusEffect)this).Battle.BattleShouldEnd)
			{
				yield break;
			}
			Card card = args.Card;
			ModFrontlineCard frontlineCard = card as ModFrontlineCard;
			if (frontlineCard == null || args.Card is HaniwaCommander)
			{
				yield break;
			}
			<>n__0();
			((Card)frontlineCard).NotifyActivating();
			foreach (BattleAction action in ((Card)frontlineCard).GetActions(HaniwaFrontlineUtils.GetTargetForOnPlayAction(((StatusEffect)this).Battle), default(ManaGroup), (Interaction)null, (IList<DamageAction>)new List<DamageAction>(), false))
			{
				if (!((StatusEffect)this).Battle.BattleShouldEnd)
				{
					yield return action;
					continue;
				}
				yield break;
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	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;
			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)
			{
				<>n__0();
				yield return (BattleAction)new DrawCardAction();
				if (((StatusEffect)this).Level <= 1)
				{
					yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
					yield break;
				}
				int level = ((StatusEffect)this).Level;
				((StatusEffect)this).Level = level - 1;
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((StatusEffect)this).NotifyActivating();
		}
	}
	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 GainBuffTickdownSeDef : 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("GainBuffTickdownSe");
		}
	}
	[EntityLogic(typeof(GainBuffTickdownSeDef))]
	public sealed class GainBuffTickdownSe : StatusEffect
	{
		protected override void OnAdded(Unit unit)
		{
			((StatusEffect)this).HandleOwnerEvent<StatusEffectApplyEventArgs>(((Unit)((StatusEffect)this).Battle.Player).StatusEffectAdded, (GameEventHandler<StatusEffectApplyEventArgs>)OnStatusEffectAdded);
			((StatusEffect)this).ReactOwnerEvent<UnitEventArgs>(((Unit)((StatusEffect)this).Battle.Player).TurnEnded, (EventSequencedReactor<UnitEventArgs>)OnPlayerTurnEnded);
		}

		private IEnumerable<BattleAction> OnPlayerTurnEnded(UnitEventArgs args)
		{
			yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
		}

		private void OnStatusEffectAdded(StatusEffectApplyEventArgs args)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Invalid comparison between Unknown and I4
			if (((StatusEffect)this).Battle.BattleShouldEnd || (int)args.Effect.Type > 0)
			{
				return;
			}
			IEnumerable<StatusEffect> enumerable = ((Unit)((StatusEffect)this).Battle.Player).StatusEffects.Where((StatusEffect s) => s is ModAssignStatusEffect);
			foreach (ModAssignStatusEffect item in enumerable)
			{
				item.Tickdown(((StatusEffect)this).Level);
			}
		}
	}
}
namespace LBoLMod.PlayerUnits
{
	public sealed class PlayerDef : PlayerUnitTemplate
	{
		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("ThePlayer");
		}

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

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

		public override PlayerUnitConfig MakeConfig()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Expected O, but got Unknown
			int? num = 0;
			ManaGroup val = default(ManaGroup);
			((ManaGroup)(ref val)).Red = 2;
			((ManaGroup)(ref val)).White = 2;
			return new PlayerUnitConfig("ThePlayer", 6, 0, num, "", "#f4cd39", true, 85, val, 50, 0, "UltimateSkillA", "UltimateSkillB", IdContainer.op_Implicit(((EntityDefinition)new AssignExhibitDef()).UniqueId), IdContainer.op_Implicit(((EntityDefinition)new FrontlineExhibitDef()).UniqueId), (IReadOnlyList<string>)GetDeckA(), (IReadOnlyList<string>)GetDeckB(), 3, 3);
		}

		private static List<string> GetDeckA()
		{
			return new List<string>
			{
				"Shoot", "Shoot", "Boundary", "Boundary", "BasicAttackR", "BasicAttackR", "BasicBlockW", "BasicBlockW", "BasicBlockW", "ArcherPrepVolley",
				"AssignHaniwaCreate"
			};
		}

		private static List<string> GetDeckB()
		{
			return new List<string>
			{
				"Shoot", "Shoot", "Boundary", "Boundary", "BasicAttackW", "BasicAttackW", "BasicBlockR", "BasicBlockR", "BasicBlockR", "SummonHaniwa",
				"FrontlineHaniwaCreate"
			};
		}
	}
	[EntityLogic(typeof(PlayerDef))]
	public sealed class ThePlayer : PlayerUnit
	{
		public int StartingHaniwa => 3;

		protected override void OnEnterBattle(BattleController battle)
		{
			((Unit)this).ReactBattleEvent<UnitEventArgs>(((Unit)this).TurnStarted, (Func<UnitEventArgs, IEnumerable<BattleAction>>)OnTurnStarted);
		}

		private IEnumerable<BattleAction> OnTurnStarted(UnitEventArgs args)
		{
			bool assign = ((PlayerUnit)this).HasExhibit<AssignExhibit>();
			bool frontline = ((PlayerUnit)this).HasExhibit<FrontlineExhibit>();
			bool hasHaniwa = HaniwaUtils.HasAnyHaniwa((PlayerUnit)(object)this);
			if (!(assign || frontline || hasHaniwa) && ((Unit)this).TurnCounter == 1)
			{
				yield return (BattleAction)(object)new GainHaniwaAction(StartingHaniwa, StartingHaniwa, StartingHaniwa);
			}
		}
	}
}
namespace LBoLMod.Patches
{
	[HarmonyPatch]
	internal class AddingGameEventsPatch
	{
		[HarmonyPatch(typeof(GameRunController), "EnterBattle")]
		private static void Prefix(Unit __instance)
		{
			ModGameEvents.Init();
		}
	}
	[HarmonyPatch(typeof(CardWidget), "OnActivating")]
	internal class HaniwaBodyguardCardWidgetPatch
	{
		private static void Postfix(CardWidget __instance)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			if (((GameEntity)__instance._card).Id == "HaniwaBodyguard")
			{
				HaniwaBodyguard haniwaBodyguard = (HaniwaBodyguard)(object)__instance._card;
				if (haniwaBodyguard.DamageTaken > 0)
				{
					PopupHud.Instance.PopupFromScene(haniwaBodyguard.DamageTaken, PopupHud.PlayerHitColor, ((Component)__instance).transform.position + new Vector3(0f, 13f));
				}
			}
		}
	}
	[HarmonyPatch(typeof(CardWidget), "SetProperties")]
	internal class ModFrontlineCardWidgetPatch
	{
		private static void Postfix(CardWidget __instance)
		{
			if (__instance._card is ModFrontlineCard modFrontlineCard)
			{
				__instance.baseLoyaltyObj.SetActive(true);
				((TMP_Text)__instance.baseLoyalty).text = modFrontlineCard.RemainingValue.ToString();
			}
		}
	}
	[HarmonyPatch]
	internal class StatusEffectWidgetPatch
	{
		[HarmonyPatch(typeof(StatusEffectWidget), "TextRefresh")]
		private static void Postfix(StatusEffectWidget __instance)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			Vector3 centerWorldPosition = __instance.CenterWorldPosition;
			ModHaniwaStatusEffect modHaniwaStatusEffect = __instance._statusEffect as ModHaniwaStatusEffect;
			if (modHaniwaStatusEffect == null && __instance._statusEffect is ModAssignStatusEffect modAssignStatusEffect)
			{
				if (modAssignStatusEffect.IsPaused)
				{
					((TMP_Text)__instance.downText).text = "P";
					((Graphic)__instance.downText).color = new Color(102f, 255f, 102f);
				}
				else if (modAssignStatusEffect.IsPermanent)
				{
					((TMP_Text)__instance.downText).text = "∞";
				}
				else if (((StatusEffect)modAssignStatusEffect).Level <= 1)
				{
					((TMP_Text)__instance.downText).text = "";
				}
			}
		}
	}
}
namespace LBoLMod.GameEvents
{
	public sealed class ModGameEvents
	{
		public static GameEvent<AssignTriggerEventArgs> AssignEffectTriggering { get; set; } = new GameEvent<AssignTriggerEventArgs>();


		public static GameEvent<AssignTriggerEventArgs> AssignEffectTriggered { get; set; } = new GameEvent<AssignTriggerEventArgs>();


		public static GameEvent<LoseHaniwaEventArgs> LosingHaniwa { get; set; } = new GameEvent<LoseHaniwaEventArgs>();


		public static GameEvent<LoseHaniwaEventArgs> LostHaniwa { get; set; } = new GameEvent<LoseHaniwaEventArgs>();


		public static GameEvent<LoseHaniwaEventArgs> SacrificingHaniwa { get; set; } = new GameEvent<LoseHaniwaEventArgs>();


		public static GameEvent<LoseHaniwaEventArgs> SacrificedHaniwa { get; set; } = new GameEvent<LoseHaniwaEventArgs>();


		public static GameEvent<LoseHaniwaEventArgs> AssigningHaniwa { get; set; } = new GameEvent<LoseHaniwaEventArgs>();


		public static GameEvent<LoseHaniwaEventArgs> AssignedHaniwa { get; set; } = new GameEvent<LoseHaniwaEventArgs>();


		public static GameEvent<GainHaniwaEventArgs> GainingHaniwa { get; set; } = new GameEvent<GainHaniwaEventArgs>();


		public static GameEvent<GainHaniwaEventArgs> GainedHaniwa { get; set; } = new GameEvent<GainHaniwaEventArgs>();


		public static GameEvent<GainHaniwaEventArgs> GainingHaniwaFromAssign { get; set; } = new GameEvent<GainHaniwaEventArgs>();


		public static GameEvent<GainHaniwaEventArgs> GainedHaniwaFromAssign { get; set; } = new GameEvent<GainHaniwaEventArgs>();


		public static GameEvent<AssignPauseEventArgs> AssignStatusPausing { get; set; } = new GameEvent<AssignPauseEventArgs>();


		public static GameEvent<AssignPauseEventArgs> AssignStatusPaused { get; set; } = new GameEvent<AssignPauseEventArgs>();


		public static void Init()
		{
			AssignEffectTriggering = new GameEvent<AssignTriggerEventArgs>();
			AssignEffectTriggered = new GameEvent<AssignTriggerEventArgs>();
			LosingHaniwa = new GameEvent<LoseHaniwaEventArgs>();
			LostHaniwa = new GameEvent<LoseHaniwaEventArgs>();
			SacrificingHaniwa = new GameEvent<LoseHaniwaEventArgs>();
			SacrificedHaniwa = new GameEvent<LoseHaniwaEventArgs>();
			AssigningHaniwa = new GameEvent<LoseHaniwaEventArgs>();
			AssignedHaniwa = new GameEvent<LoseHaniwaEventArgs>();
			GainingHaniwa = new GameEvent<GainHaniwaEventArgs>();
			GainedHaniwa = new GameEvent<GainHaniwaEventArgs>();
			GainingHaniwaFromAssign = new GameEvent<GainHaniwaEventArgs>();
			GainedHaniwaFromAssign = new GameEvent<GainHaniwaEventArgs>();
			AssignStatusPausing = new GameEvent<AssignPauseEventArgs>();
			AssignStatusPaused = new GameEvent<AssignPauseEventArgs>();
		}
	}
}
namespace LBoLMod.Exhibits
{
	public sealed class AssignExhibitDef : ExhibitTemplate
	{
		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("AssignExhibit");
		}

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

		public override ExhibitSprites LoadSprite()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			return new ExhibitSprites(ResourceLoader.LoadSprite("assignexhibit.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null));
		}

		public override ExhibitConfig MakeConfig()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			string text = IdContainer.op_Implicit(((EntityDefinition)new PlayerDef()).UniqueId);
			int? num = 3;
			int? num2 = 1;
			int? num3 = 1;
			ManaGroup value = default(ManaGroup);
			((ManaGroup)(ref value)).Red = 1;
			return new ExhibitConfig(0, "", 10, false, false, false, false, (AppearanceType)3, text, (ExhibitLosableType)1, (Rarity)3, num, num2, num3, (ManaGroup?)value, (ManaColor?)null, (ManaColor?)(ManaColor)4, 1, true, (int?)0, (Keyword)0, (IReadOnlyList<string>)new List<string> { "Haniwa", "Assign", "AssignmentBonusSe" }, (IReadOnlyList<string>)new List<string>());
		}
	}
	[EntityLogic(typeof(AssignExhibitDef))]
	public sealed class AssignExhibit : ShiningExhibit
	{
		protected override void OnEnterBattle()
		{
			((Exhibit)this).Counter = 0;
			((Exhibit)this).ReactBattleEvent<UnitEventArgs>(((Unit)((Exhibit)this).Battle.Player).TurnStarting, (EventSequencedReactor<UnitEventArgs>)onPlayerTurnStarting);
			((Exhibit)this).ReactBattleEvent<StatusEffectApplyEventArgs>(((Unit)((Exhibit)this).Battle.Player).StatusEffectAdded, (EventSequencedReactor<StatusEffectApplyEventArgs>)OnStatusEffectAdded);
		}

		private IEnumerable<BattleAction> OnStatusEffectAdded(StatusEffectApplyEventArgs args)
		{
			if (!((Exhibit)this).Battle.BattleShouldEnd && (int)args.Effect.Type == 0 && !(args.Effect is AssignmentBonusSe))
			{
				int counter = ((Exhibit)this).Counter;
				((Exhibit)this).Counter = counter + 1;
				if (((Exhibit)this).Counter >= 5)
				{
					<>n__0();
					yield return (BattleAction)(object)new ApplyStatusEffectAction<AssignmentBonusSe>((Unit)(object)((Exhibit)this).Battle.Player, (int?)1, (int?)null, (int?)null, (int?)null, 0f, true);
					((Exhibit)this).Counter = 0;
				}
			}
		}

		private IEnumerable<BattleAction> onPlayerTurnStarting(UnitEventArgs args)
		{
			PlayerUnit player = ((Exhibit)this).Battle.Player;
			if (((Unit)player).TurnCounter == 1 && !HaniwaUtils.HasAnyHaniwa(player))
			{
				<>n__0();
				yield return (BattleAction)(object)new GainHaniwaAction(((Exhibit)this).Value1, ((Exhibit)this).Value1, ((Exhibit)this).Value1);
				yield return (BattleAction)(object)new ApplyStatusEffectAction<AssignmentBonusSe>((Unit)(object)((Exhibit)this).Battle.Player, (int?)((Exhibit)this).Value3, (int?)null, (int?)null, (int?)null, 0f, true);
			}
		}

		protected override void OnLeaveBattle()
		{
			((Exhibit)this).Counter = 0;
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((Exhibit)this).NotifyActivating();
		}
	}
	public sealed class FrontlineExhibitDef : ExhibitTemplate
	{
		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("FrontlineExhibit");
		}

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

		public override ExhibitSprites LoadSprite()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			return new ExhibitSprites(ResourceLoader.LoadSprite("frontlineexhibit.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null));
		}

		public override ExhibitConfig MakeConfig()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Expected O, but got Unknown
			string text = IdContainer.op_Implicit(((EntityDefinition)new PlayerDef()).UniqueId);
			int? num = 3;
			int? num2 = 12;
			ManaGroup value = default(ManaGroup);
			((ManaGroup)(ref value)).White = 1;
			return new ExhibitConfig(0, "", 10, false, false, false, false, (AppearanceType)3, text, (ExhibitLosableType)1, (Rarity)3, num, (int?)null, num2, (ManaGroup?)value, (ManaColor?)null, (ManaColor?)(ManaColor)1, 1, false, (int?)null, (Keyword)0, (IReadOnlyList<string>)new List<string> { "Haniwa" }, (IReadOnlyList<string>)new List<string>());
		}
	}
	[EntityLogic(typeof(FrontlineExhibitDef))]
	public sealed class FrontlineExhibit : ShiningExhibit
	{
		protected override void OnEnterBattle()
		{
			((Exhibit)this).Battle.MaxHand = ((Exhibit)this).Value3;
			((Exhibit)this).ReactBattleEvent<UnitEventArgs>(((Unit)((Exhibit)this).Battle.Player).TurnStarting, (EventSequencedReactor<UnitEventArgs>)onPlayerTurnStarting);
		}

		private IEnumerable<BattleAction> onPlayerTurnStarting(UnitEventArgs args)
		{
			PlayerUnit player = ((Exhibit)this).Battle.Player;
			if (((Unit)player).TurnCounter == 1 && !HaniwaUtils.HasAnyHaniwa(player))
			{
				<>n__0();
				yield return (BattleAction)(object)new GainHaniwaAction(((Exhibit)this).Value1, ((Exhibit)this).Value1, ((Exhibit)this).Value1);
			}
		}

		[CompilerGenerated]
		[DebuggerHidden]
		private void <>n__0()
		{
			((Exhibit)this).NotifyActivating();
		}
	}
}
namespace LBoLMod.Cards
{
	public sealed class BasicAttackRDef : ModCardTemplate
	{
		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("BasicAttackR");
		}

		public override CardConfig MakeConfig()
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			CardConfig val = base.MakeConfig();
			val.IsPooled = false;
			val.FindInBattle = false;
			val.Type = (CardType)1;
			val.TargetType = (TargetType)1;
			val.Colors = new List<ManaColor> { (ManaColor)4 };
			val.Damage = 10;
			val.UpgradedDamage = 14;
			ManaGroup val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 1;
			((ManaGroup)(ref val2)).Red = 1;
			val.Cost = val2;
			val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 2;
			val.UpgradedCost = val2;
			val.Keywords = (Keyword)2;
			val.UpgradedKeywords = (Keyword)2;
			return val;
		}
	}
	[EntityLogic(typeof(BasicAttackRDef))]
	public sealed class BasicAttackR : Card
	{
	}
	public sealed class BasicAttackGDef : ModCardTemplate
	{
		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("BasicAttackW");
		}

		public override CardConfig MakeConfig()
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			CardConfig val = base.MakeConfig();
			val.IsPooled = false;
			val.FindInBattle = false;
			val.Type = (CardType)1;
			val.TargetType = (TargetType)1;
			val.Colors = new List<ManaColor> { (ManaColor)1 };
			val.Damage = 10;
			val.UpgradedDamage = 14;
			ManaGroup val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 1;
			((ManaGroup)(ref val2)).White = 1;
			val.Cost = val2;
			val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 2;
			val.UpgradedCost = val2;
			val.Keywords = (Keyword)2;
			val.UpgradedKeywords = (Keyword)2;
			return val;
		}
	}
	[EntityLogic(typeof(BasicAttackGDef))]
	public sealed class BasicAttackW : Card
	{
	}
	public sealed class BasicBlockRDef : ModCardTemplate
	{
		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("BasicBlockR");
		}

		public override CardConfig MakeConfig()
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			CardConfig val = base.MakeConfig();
			val.IsPooled = false;
			val.FindInBattle = false;
			val.Type = (CardType)2;
			val.TargetType = (TargetType)4;
			val.Colors = new List<ManaColor> { (ManaColor)4 };
			val.Block = 10;
			val.UpgradedBlock = 13;
			ManaGroup val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 1;
			((ManaGroup)(ref val2)).Red = 1;
			val.Cost = val2;
			val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 2;
			val.UpgradedCost = val2;
			val.Keywords = (Keyword)2;
			val.UpgradedKeywords = (Keyword)2;
			return val;
		}
	}
	[EntityLogic(typeof(BasicBlockRDef))]
	public sealed class BasicBlockR : Card
	{
	}
	public sealed class BasicBlockGDef : ModCardTemplate
	{
		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("BasicBlockW");
		}

		public override CardConfig MakeConfig()
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			CardConfig val = base.MakeConfig();
			val.IsPooled = false;
			val.FindInBattle = false;
			val.Type = (CardType)2;
			val.TargetType = (TargetType)4;
			val.Colors = new List<ManaColor> { (ManaColor)1 };
			val.Block = 10;
			val.UpgradedBlock = 13;
			ManaGroup val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 1;
			((ManaGroup)(ref val2)).White = 1;
			val.Cost = val2;
			val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 2;
			val.UpgradedCost = val2;
			val.Keywords = (Keyword)2;
			val.UpgradedKeywords = (Keyword)2;
			return val;
		}
	}
	[EntityLogic(typeof(BasicBlockGDef))]
	public sealed class BasicBlockW : Card
	{
	}
	public sealed class CreateHaniwaDef : ModCardTemplate
	{
		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("CreateHaniwa");
		}

		public override CardConfig MakeConfig()
		{
			CardConfig val = base.MakeConfig();
			val.IsPooled = false;
			val.HideMesuem = true;
			val.Type = (CardType)3;
			val.Value1 = 2;
			val.UpgradedValue1 = 3;
			val.Keywords = (Keyword)2228224;
			val.UpgradedKeywords = (Keyword)2228224;
			val.RelativeEffects = new List<string> { "Haniwa" };
			val.UpgradedRelativeEffects = new List<string> { "Haniwa" };
			return val;
		}
	}
	[EntityLogic(typeof(CreateHaniwaDef))]
	public sealed class CreateHaniwa : Card
	{
		public override Interaction Precondition()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			List<Card> list = new List<Card>
			{
				(Card)(object)Library.CreateCard<CreateHaniwaFencer>(((Card)this).IsUpgraded),
				(Card)(object)Library.CreateCard<CreateHaniwaArcher>(((Card)this).IsUpgraded),
				(Card)(object)Library.CreateCard<CreateHaniwaCavalry>(((Card)this).IsUpgraded)
			};
			return (Interaction)new MiniSelectCardInteraction((IEnumerable<Card>)list, false, false, false);
		}

		protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			MiniSelectCardInteraction interaction = (MiniSelectCardInteraction)(object)((precondition is MiniSelectCardInteraction) ? precondition : null);
			if (interaction == null)
			{
				yield break;
			}
			Card selectedCard = interaction.SelectedCard;
			OptionCard optionCard = (OptionCard)(object)((selectedCard is OptionCard) ? selectedCard : null);
			if (optionCard == null)
			{
				yield break;
			}
			((Card)optionCard).SetBattle(((Card)this).Battle);
			foreach (BattleAction item in optionCard.TakeEffectActions())
			{
				yield return item;
			}
		}
	}
	public sealed class CreateHaniwaArcherDef : ModCardTemplate
	{
		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("CreateHaniwaArcher");
		}

		public override CardConfig MakeConfig()
		{
			CardConfig val = base.MakeConfig();
			val.IsPooled = false;
			val.HideMesuem = true;
			val.Type = (CardType)3;
			val.Value1 = 2;
			val.UpgradedValue1 = 3;
			val.RelativeEffects = new List<string> { "Haniwa" };
			val.UpgradedRelativeEffects = new List<string> { "Haniwa" };
			return val;
		}
	}
	[EntityLogic(typeof(CreateHaniwaArcherDef))]
	public sealed class CreateHaniwaArcher : OptionCard
	{
		public override IEnumerable<BattleAction> TakeEffectActions()
		{
			yield return (BattleAction)(object)new GainHaniwaAction(0, ((Card)this).Value1);
		}
	}
	public sealed class CreateHaniwaCavalryDef : ModCardTemplate
	{
		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("CreateHaniwaCavalry");
		}

		public override CardConfig MakeConfig()
		{
			CardConfig val = base.MakeConfig();
			val.IsPooled = false;
			val.HideMesuem = true;
			val.Type = (CardType)3;
			val.Value1 = 2;
			val.UpgradedValue1 = 3;
			val.RelativeEffects = new List<string> { "Haniwa" };
			val.UpgradedRelativeEffects = new List<string> { "Haniwa" };
			return val;
		}
	}
	[EntityLogic(typeof(CreateHaniwaCavalryDef))]
	public sealed class CreateHaniwaCavalry : OptionCard
	{
		public override IEnumerable<BattleAction> TakeEffectActions()
		{
			yield return (BattleAction)(object)new GainHaniwaAction(0, 0, ((Card)this).Value1);
		}
	}
	public sealed class CreateHaniwaFencerDef : ModCardTemplate
	{
		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("CreateHaniwaFencer");
		}

		public override CardConfig MakeConfig()
		{
			CardConfig val = base.MakeConfig();
			val.IsPooled = false;
			val.HideMesuem = true;
			val.Type = (CardType)3;
			val.Value1 = 2;
			val.UpgradedValue1 = 3;
			val.RelativeEffects = new List<string> { "Haniwa" };
			val.UpgradedRelativeEffects = new List<string> { "Haniwa" };
			return val;
		}
	}
	[EntityLogic(typeof(CreateHaniwaFencerDef))]
	public sealed class CreateHaniwaFencer : OptionCard
	{
		public override IEnumerable<BattleAction> TakeEffectActions()
		{
			yield return (BattleAction)(object)new GainHaniwaAction(((Card)this).Value1);
		}
	}
	public sealed class DefenceCreateReservesDef : ModCardTemplate
	{
		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("DefenceCreateReserves");
		}

		public override CardConfig MakeConfig()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			CardConfig val = base.MakeConfig();
			val.Type = (CardType)2;
			val.Colors = new List<ManaColor>
			{
				(ManaColor)4,
				(ManaColor)1
			};
			ManaGroup val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 1;
			((ManaGroup)(ref val2)).Hybrid = 1;
			((ManaGroup)(ref val2)).HybridColor = 2;
			val.Cost = val2;
			val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 2;
			val.UpgradedCost = val2;
			val.Block = 12;
			val.UpgradedBlock = 15;
			val.Value1 = 1;
			val.UpgradedValue1 = 2;
			val.RelativeCards = new List<string> { "CreateHaniwa" };
			val.UpgradedRelativeCards = new List<string> { "CreateHaniwa" };
			return val;
		}
	}
	[EntityLogic(typeof(DefenceCreateReservesDef))]
	public sealed class DefenceCreateReserves : Card
	{
		protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			yield return ((Card)this).DefenseAction(true);
			yield return (BattleAction)new AddCardsToHandAction((IEnumerable<Card>)Library.CreateCards<CreateHaniwa>(((Card)this).Value1, false), (AddCardsType)0);
		}
	}
	public sealed class HybridDrawDef : ModCardTemplate
	{
		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("HybridDraw");
		}

		public override CardConfig MakeConfig()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			CardConfig val = base.MakeConfig();
			val.Type = (CardType)3;
			val.Colors = new List<ManaColor>
			{
				(ManaColor)4,
				(ManaColor)1
			};
			ManaGroup val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Hybrid = 1;
			((ManaGroup)(ref val2)).HybridColor = 2;
			val.Cost = val2;
			val2 = default(ManaGroup);
			((ManaGroup)(ref val2)).Any = 1;
			val.UpgradedCost = val2;
			val.Value1 = 1;
			val.UpgradedValue1 = 2;
			val.RelativeEffects = new List<string> { "Frontline", "Assign" };
			val.UpgradedRelativeEffects = new List<string> { "Frontline", "Assign" };
			return val;
		}
	}
	[EntityLogic(typeof(HybridDrawDef))]
	public sealed class HybridDraw : Card
	{
		public int AssignRequirement => 1;

		public int FrontlineRequirement => 1;

		protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			yield return (BattleAction)new DrawManyCardAction(((Card)this).Value1);
			int assignStatuses = ((Unit)((Card)this).Battle.Player).StatusEffects.Where((StatusEffect s) => s is ModAssignStatusEffect).Count();
			if (assignStatuses >= AssignRequirement)
			{
				yield return (BattleAction)new DrawCardAction();
			}
			int frontlineCards = ((Card)this).Battle.HandZone.Where((Card c) => c is ModFrontlineCard).Count();
			if (frontlineCards >= FrontlineRequirement)
			{
				yield return (BattleAction)new DrawCardAction();
			}
		}
	}
	public sealed class ArcherPrepVolleyDef : ModCardTemplate
	{
		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("ArcherPrepVolley");
		}

		public override CardConfig MakeConfig()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			CardConfig val = base.MakeConfig();
			val.Type = (CardType)1;
			val.Colors = new List<ManaColor> { (ManaColor)4 };
			ManaGroup cost = default(ManaGroup);
			((ManaGroup)(ref cost)).Any = 0;