Decompiled source of Stackable Burst v1.1.1

lvalonburst.dll

Decompiled a week ago
using System.Collections.Generic;
using System.Diagnostics;
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 HarmonyLib;
using LBoL.Base;
using LBoL.ConfigData;
using LBoL.Core;
using LBoL.Core.Battle;
using LBoL.Core.Cards;
using LBoL.Core.StatusEffects;
using LBoLEntitySideloader;
using LBoLEntitySideloader.Attributes;
using LBoLEntitySideloader.Entities;
using LBoLEntitySideloader.Resource;
using LBoLEntitySideloader.Utils;
using UnityEngine;

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

		internal static ManualLogSource log;

		internal static TemplateSequenceTable sequenceTable = new TemplateSequenceTable(0);

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

		internal static DirectorySource directorySource = new DirectorySource("llbol.release.burst", "");

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

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

		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();
			}
		}
	}
	[OverwriteVanilla]
	public sealed class BurstDef : StatusEffectTemplate
	{
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private class BurstForceNotShowNumberGetter_Patch
		{
			private static void Postfix(Burst __instance, ref bool __result)
			{
				__result = false;
			}
		}

		[HarmonyPatch]
		private class BurstDamageRateGetter_Patch
		{
			private static IEnumerable<MethodBase> TargetMethods()
			{
				yield return AccessTools.PropertyGetter(typeof(Burst), "DamageRate");
			}

			private static void Postfix(Burst __instance, ref int __result)
			{
				if (((StatusEffect)__instance).Owner != null)
				{
					BurstUpgrade statusEffect = ((StatusEffect)__instance).Owner.GetStatusEffect<BurstUpgrade>();
					int num = 1;
					if (statusEffect != null)
					{
						num = ((StatusEffect)statusEffect).Level;
					}
					__result = __result + ((StatusEffect)__instance).Level - 1 + num - 1;
				}
			}
		}

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

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

		[DontOverwrite]
		public override Sprite LoadSprite()
		{
			return null;
		}

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			StatusEffectConfig val = ObjectExtensions.Copy<StatusEffectConfig>(StatusEffectConfig.FromId(IdContainer.op_Implicit(((EntityDefinition)this).GetId())));
			val.HasLevel = true;
			val.IsStackable = true;
			val.CountStackType = (StackType)0;
			return val;
		}
	}
	[OverwriteVanilla]
	public sealed class BurstUpgradeDef : StatusEffectTemplate
	{
		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("BurstUpgrade");
		}

		[DontOverwrite]
		public override LocalizationOption LoadLocalization()
		{
			return null;
		}

		[DontOverwrite]
		public override Sprite LoadSprite()
		{
			return null;
		}

		public override StatusEffectConfig MakeConfig()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			StatusEffectConfig val = ObjectExtensions.Copy<StatusEffectConfig>(StatusEffectConfig.FromId(IdContainer.op_Implicit(((EntityDefinition)this).GetId())));
			val.HasLevel = true;
			val.IsStackable = true;
			val.CountStackType = (StackType)0;
			return val;
		}
	}
	[OverwriteVanilla]
	public sealed class HuoliQuankaiDef : CardTemplate
	{
		[EntityLogic(typeof(HuoliQuankaiDef))]
		public sealed class HuoliQuankai : 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).BuffAction<BurstUpgrade>(1, 0, 0, 0, 0.2f);
				if (((Card)this).IsUpgraded)
				{
					yield return ((Card)this).BuffAction<Burst>(1, 0, 0, 0, 0.2f);
				}
				else
				{
					yield return ((Card)this).BuffAction<Charging>(((Card)this).Value1, 0, 0, 0, 0.2f);
				}
			}
		}

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

		[DontOverwrite]
		public override CardImages LoadCardImages()
		{
			return null;
		}

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

		[DontOverwrite]
		public override CardConfig MakeConfig()
		{
			return null;
		}
	}
	public static class PInfo
	{
		public const string GUID = "llbol.release.burst";

		public const string Name = "llvalonburst";

		public const string version = "1.1.1";

		public static readonly Harmony harmony = new Harmony("llbol.release.burst");
	}
	internal class WatermarkWrapper
	{
		[MethodImpl(MethodImplOptions.NoInlining)]
		internal static void ActivateWatermark()
		{
			API.ActivateWatermark();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}