Decompiled source of PermaDeath v1.0.0

GeckVolantMarin-PermaDeath.dll

Decompiled 3 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using DiskCardGame;
using HarmonyLib;
using InscryptionAPI.Ascension;
using InscryptionAPI.Card;
using InscryptionAPI.Helpers;
using Microsoft.CodeAnalysis;
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: AssemblyCompany("GeckVolantMarin-PermaDeath")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GeckVolantMarin-PermaDeath")]
[assembly: AssemblyTitle("GeckVolantMarin-PermaDeath")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace GeckVolantMarin
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "GeckVolantMarin-PermaDeath";

		public const string PLUGIN_NAME = "GeckVolantMarin-PermaDeath";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace PermaDeath
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "GeckVolantMarin-PermaDeath";

		public const string PLUGIN_NAME = "GeckVolantMarin-PermaDeath";

		public const string PLUGIN_VERSION = "1.0.0";
	}
	[BepInPlugin("GeckVolantMarin-PermaDeath", "GeckVolantMarin-PermaDeath", "1.0.0")]
	[BepInProcess("Inscryption.exe")]
	[HarmonyPatch]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		public static string directory;

		private readonly Harmony HarmonyInstance = new Harmony("GeckVolantMarin-PermaDeath");

		private static AscensionChallengeInfo permaDeathChallenge;

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		private static void PermaDeathPatch(ref CardInfo __result)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(permaDeathChallenge.challengeType))
			{
				CardExtensions.AddAbilities(__result, (Ability[])(object)new Ability[1] { (Ability)55 });
			}
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		private static void PermaDeathPatch2(ref CardInfo __result)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(permaDeathChallenge.challengeType))
			{
				CardExtensions.AddAbilities(__result, (Ability[])(object)new Ability[1] { (Ability)55 });
			}
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		private static void PermaDeathPatch3(CardCollectionInfo __instance)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if (!SaveFile.IsAscension || !AscensionSaveData.Data.ChallengeIsActive(permaDeathChallenge.challengeType))
			{
				return;
			}
			foreach (CardInfo cardInfo in __instance.CardInfos)
			{
				CardExtensions.AddAbilities(cardInfo, (Ability[])(object)new Ability[1] { (Ability)55 });
			}
		}

		private void createPermaDeathChallenge()
		{
			FullChallenge val = ChallengeManager.AddSpecific("GeckVolantMarin-PermaDeath", "Perma Death", "All cards have the perma death sigil.", 100, TextureHelper.GetImageAsTexture("permaDeathChallenge.png", (FilterMode)0), TextureHelper.GetImageAsTexture("permaDeathChallengeEmission.png", (FilterMode)0), 10, 1);
			permaDeathChallenge = val.Challenge;
		}

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			directory = ((BaseUnityPlugin)this).Info.Location;
			createPermaDeathChallenge();
			HarmonyInstance.PatchAll(typeof(Plugin).Assembly);
			Logger.LogInfo((object)"Reussi?");
			Logger.LogInfo((object)"Plugin GeckVolantMarin-PermaDeath is loaded!");
		}
	}
}