Decompiled source of LesserSideDeck v1.0.1

GeckVolantMarin-LesserSideDeck.dll

Decompiled 4 hours ago
using System;
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 BepInEx;
using BepInEx.Logging;
using DiskCardGame;
using HarmonyLib;
using InscryptionAPI.Ascension;
using InscryptionAPI.Helpers;
using InscryptionAPI.Helpers.Extensions;
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-LesserSideDeck")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GeckVolantMarin-LesserSideDeck")]
[assembly: AssemblyTitle("GeckVolantMarin-LesserSideDeck")]
[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-LesserSideDeck";

		public const string PLUGIN_NAME = "GeckVolantMarin-LesserSideDeck";

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

		public const string PLUGIN_NAME = "GeckVolantMarin-LesserSideDeck";

		public const string PLUGIN_VERSION = "1.0.0";
	}
	[BepInPlugin("GeckVolantMarin-LesserSideDeck", "GeckVolantMarin-LesserSideDeck", "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-LesserSideDeck");

		private static AscensionChallengeInfo removeOneFromSideDeckChallenge;

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		public static void ReplaceSideDeck(ref List<CardInfo> __result)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			if (!SaveFile.IsAscension)
			{
				return;
			}
			int num = 0;
			foreach (AscensionChallenge activeChallenge in AscensionSaveData.Data.activeChallenges)
			{
				if (activeChallenge == removeOneFromSideDeckChallenge.challengeType)
				{
					num += 2;
				}
			}
			for (int i = 0; i < num; i++)
			{
				Logger.LogInfo((object)("Removed " + i + "from side deck"));
				if (__result.Count > 0)
				{
					ListExtensions.PopLast<CardInfo>(__result);
				}
			}
		}

		private void createRemoveOneFromSideDeckChallenge()
		{
			FullChallenge val = ChallengeManager.AddSpecific("GeckVolantMarin-LesserSideDeck", "Smaller Side Deck", "Remove 2 cards from your side deck.", 5, TextureHelper.GetImageAsTexture("removeOneFromSideDeckChallenge.png", (FilterMode)0), TextureHelper.GetImageAsTexture("removeOneFromSideDeckChallengeEmission.png", (FilterMode)0), 6, 4);
			removeOneFromSideDeckChallenge = val.Challenge;
		}

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