Decompiled source of HTUnlimitedReversals v1.0.1

plugins/UnlimitedReversals.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[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("UnlimitedReversals")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("UnlimitedReversals")]
[assembly: AssemblyTitle("UnlimitedReversals")]
[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 UnlimitedReversals
{
	[BepInPlugin("GeeEm.HardTime.UnlimitedReversals", "UnlimitedReversals", "1.0.0")]
	[HarmonyPatch]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "GeeEm.HardTime.UnlimitedReversals";

		public const string PluginName = "UnlimitedReversals";

		public const string PluginVer = "1.0.0";

		internal static ManualLogSource Log;

		internal static readonly Harmony Harmony = new Harmony("GeeEm.HardTime.UnlimitedReversals");

		internal static string PluginPath;

		public static ConfigEntry<bool> DisableBotches;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			PluginPath = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			DisableBotches = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "DisableBotches", false, "Move botching (when both wrestlers fall down) will be disabled");
		}

		private void OnEnable()
		{
			Harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded UnlimitedReversals!");
		}

		private void OnDisable()
		{
			Harmony.UnpatchSelf();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Unloaded UnlimitedReversals!");
		}

		[HarmonyPatch(typeof(DFOGOCNBECG), "AHOHHCDBLMA")]
		[HarmonyPrefix]
		private static void DFOGOCNBECG_AHOHHCDBLMAPrefix(DFOGOCNBECG __instance, DFOGOCNBECG ELPIOHCPOIJ, ref int DGJAEIBKLJO, int GBEJFLOIBOH, float DILPLMPNICB, float KMNBIPKAJAE = 0f)
		{
			if (ELPIOHCPOIJ.EMDMDLNJFKP.id == Characters.star)
			{
				DGJAEIBKLJO = int.MaxValue;
			}
		}

		[HarmonyPatch(typeof(DFOGOCNBECG), "PCHGFNPPOEM")]
		[HarmonyPrefix]
		private static void DFOGOCNBECG_PCHGFNPPOEMPrefix(DFOGOCNBECG __instance, DFOGOCNBECG ELPIOHCPOIJ, ref int DGJAEIBKLJO, float NIIEGJGDAAM = -1f)
		{
			if (ELPIOHCPOIJ.EMDMDLNJFKP.id == Characters.star)
			{
				DGJAEIBKLJO = int.MaxValue;
			}
		}

		[HarmonyPatch(typeof(DFOGOCNBECG), "JPPFMOKHMNE")]
		[HarmonyPrefix]
		private static void DFOGOCNBECG_JPPFMOKHMNEPrefix(DFOGOCNBECG __instance, int FFFFLHENONC, ref int DGJAEIBKLJO)
		{
			if (DisableBotches.Value && (__instance.ELPIOHCPOIJ.EMDMDLNJFKP.id == Characters.star || __instance.EMDMDLNJFKP.id == Characters.star))
			{
				DGJAEIBKLJO = int.MinValue;
			}
		}

		[HarmonyPatch(typeof(DFOGOCNBECG), "GEJEKGNJGFG")]
		[HarmonyPrefix]
		private static void DFOGOCNBECG_GEJEKGNJGFGPrefix(DFOGOCNBECG __instance, DFOGOCNBECG ELPIOHCPOIJ, ref float DGJAEIBKLJO)
		{
			if (ELPIOHCPOIJ.EMDMDLNJFKP.id == Characters.star)
			{
				DGJAEIBKLJO = 0f;
			}
		}

		[HarmonyPatch(typeof(DFOGOCNBECG), "NPOCCMLMFCL")]
		[HarmonyPrefix]
		private static bool DFOGOCNBECG_NPOCCMLMFCLPrefix(DFOGOCNBECG __instance, ref float __result, DFOGOCNBECG ELPIOHCPOIJ)
		{
			if (ELPIOHCPOIJ.EMDMDLNJFKP.id != Characters.star)
			{
				return true;
			}
			__result = 0f;
			return false;
		}
	}
}