Decompiled source of Revolution Pricing v1.0.1

RevolutionPricing.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
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: AssemblyTitle("Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mod")]
[assembly: AssemblyCopyright("Copyright ©  2020")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("57445610-0892-47c3-be16-453172104123")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[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 RevolutionPricing
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("kitsune.etg.revolutionpricing", "Free Gunslinger And Paradox", "1.0.1")]
	[HarmonyPatch]
	public class Plugin : BaseUnityPlugin
	{
		public const string GUID = "kitsune.etg.revolutionpricing";

		public const string NAME = "Free Gunslinger And Paradox";

		public const string VERSION = "1.0.1";

		public const string TEXT_COLOR = "#32CD32";

		public void Start()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("kitsune.etg.revolutionpricing");
			val.PatchAll(Assembly.GetExecutingAssembly());
			ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
		}

		public void GMStart(GameManager g)
		{
			Log("Free Gunslinger And Paradox v1.0.1 started successfully.", "#32CD32");
		}

		[HarmonyPatch(typeof(FoyerCharacterSelectFlag), "Start")]
		[HarmonyPostfix]
		public static void RemoveGunslingerAndParadoxPriceFromFoyer(FoyerCharacterSelectFlag __instance)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Invalid comparison between Unknown and I4
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Invalid comparison between Unknown and I4
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			bool flag = (Object)(object)__instance.OverheadElement != (Object)null && (Object)(object)__instance.OverheadElement.GetComponent<FoyerInfoPanelController>() != (Object)null;
			bool flag2 = (int)__instance.OverheadElement.GetComponent<FoyerInfoPanelController>().characterIdentity == 9 || ((Object)__instance.OverheadElement.GetComponent<FoyerInfoPanelController>()).name.Equals("CHR_EeveePanel");
			bool flag3 = (int)__instance.OverheadElement.GetComponent<FoyerInfoPanelController>().characterIdentity == 10 || ((Object)__instance.OverheadElement.GetComponent<FoyerInfoPanelController>()).name.Equals("CHR_GunslingerPanel");
			if (flag && flag3)
			{
				__instance.IsGunslinger = false;
				__instance.OverheadElement.GetComponent<FoyerInfoPanelController>().characterIdentity = (PlayableCharacters)0;
			}
			else if (flag && flag2)
			{
				__instance.IsEevee = false;
				__instance.OverheadElement.GetComponent<FoyerInfoPanelController>().characterIdentity = (PlayableCharacters)0;
			}
		}

		[HarmonyPatch(typeof(AmmonomiconDeathPageController), "GetNumMetasToQuickRestart")]
		[HarmonyPostfix]
		public static void FreeQuickRestart(AmmonomiconDeathPageController __instance, ref QuickRestartOptions __result)
		{
			__result.NumMetas = 0;
		}

		public static void Log(string text, string color = "FFFFFF")
		{
			ETGModConsole.Log((object)("<color=" + color + ">" + text + "</color>"), false);
		}
	}
}