Decompiled source of BRC PostGameCharacters v1.0.5

BRC_PostGameCharacters.dll

Decompiled 2 months 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.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Reptile;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("BRC_PostGameCharacters")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Allows you to access characters at the Cypher that normally can't be unlocked in post game.")]
[assembly: AssemblyFileVersion("1.0.5.0")]
[assembly: AssemblyInformationalVersion("1.0.5+159e665a309743d133c1e74d9f7bc32b39aa6ab5")]
[assembly: AssemblyProduct("BRC_PostGameCharacters")]
[assembly: AssemblyTitle("BRC_PostGameCharacters")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.5.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 BRC_PostGameCharacters
{
	[BepInPlugin("BRC_PostGameCharacters", "BRC_PostGameCharacters", "1.0.5")]
	[BepInProcess("Bomb Rush Cyberfunk.exe")]
	public class Plugin : BaseUnityPlugin
	{
		public static ConfigEntry<bool> BoostpacklessFaux;

		public void Awake()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			BoostpacklessFaux = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Boostpackless Faux", false, "Adds boostpackless Faux to the Cypher.");
			new Harmony("BRC_PostGameCharacters").PatchAll();
		}
	}
	[HarmonyPatch(typeof(CharacterSelect))]
	public class CharacterSelectPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("PopulateListOfSelectableCharacters")]
		public static void PopulateListOfSelectableCharacters_Postfix(CharacterSelect __instance, Player player)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			if ((int)Story.GetCurrentObjectiveInfo().chapter == 6)
			{
				if (IsValid((Characters)12, __instance, player))
				{
					__instance.selectableCharacters.Add((Characters)12);
				}
				if (IsValid((Characters)25, __instance, player))
				{
					__instance.selectableCharacters.Add((Characters)25);
				}
				if (IsValid((Characters)24, __instance, player))
				{
					__instance.selectableCharacters.Add((Characters)24);
				}
				if (Plugin.BoostpacklessFaux.Value && IsValid((Characters)23, __instance, player))
				{
					__instance.selectableCharacters.Add((Characters)23);
				}
				__instance.Shuffle(__instance.selectableCharacters);
			}
		}

		public static bool IsValid(Characters character, CharacterSelect __instance, Player player)
		{
			//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)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (!__instance.selectableCharacters.Contains(character))
			{
				return player.character != character;
			}
			return false;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "BRC_PostGameCharacters";

		public const string PLUGIN_NAME = "BRC_PostGameCharacters";

		public const string PLUGIN_VERSION = "1.0.5";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}