Decompiled source of MoreRingSizes v1.0.0

plugins/MoreRingSizes.dll

Decompiled a year 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.Logging;
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: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("MoreRingSizes")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MoreRingSizes")]
[assembly: AssemblyTitle("MoreRingSizes")]
[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 MoreRingSizes
{
	[BepInPlugin("GeeEm.WrestlingEmpire.MoreRingSizes", "MoreRingSizes", "1.0.0")]
	[HarmonyPatch]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "GeeEm.WrestlingEmpire.MoreRingSizes";

		public const string PluginName = "MoreRingSizes";

		public const string PluginVer = "1.0.0";

		internal static ManualLogSource Log;

		internal static readonly Harmony Harmony = new Harmony("GeeEm.WrestlingEmpire.MoreRingSizes");

		internal static string PluginPath;

		public static float? ringSize = null;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			PluginPath = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
		}

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

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

		[HarmonyPatch(typeof(World), "MNCIAPLCFDM")]
		[HarmonyPrefix]
		private static bool World_MNCIAPLCFDMPrefix(ref float __result)
		{
			if (World.location == 1 || World.location == 0 || World.location == -1)
			{
				__result = 1.65f;
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(AKFIIKOMPLL), "ODONMLDCHHF")]
		[HarmonyPrefix]
		private static bool AKFIIKOMPLL_ODONMLDCHHFPrefix(AKFIIKOMPLL __instance, ref float __result, ref float CAAJBNHEFJJ, float OEGLNPMNEOE, float NOGFHHECJBM, ref float JBPAELFIDOP, float LKBOHHGFJFO, int LKJHMOHMKCM)
		{
			if (NAEEIFNFBBO.CBMHGKFFHJE != 1 && LIPNHOMGGHF.CHLJMEPFJOK == 1 && LIPNHOMGGHF.ODOAPLMOJPD == 1 && __instance == LIPNHOMGGHF.FKANHDIMMBJ[8])
			{
				JBPAELFIDOP = 0.2f;
			}
			return true;
		}

		[HarmonyPatch(typeof(AKFIIKOMPLL), "ODONMLDCHHF")]
		[HarmonyPostfix]
		private static void AKFIIKOMPLL_ODONMLDCHHFPostfix(AKFIIKOMPLL __instance, ref float __result, float CAAJBNHEFJJ, float OEGLNPMNEOE, float NOGFHHECJBM, ref float JBPAELFIDOP, float LKBOHHGFJFO, int LKJHMOHMKCM)
		{
			if (NAEEIFNFBBO.CBMHGKFFHJE != 1 && LIPNHOMGGHF.CHLJMEPFJOK == 1 && LIPNHOMGGHF.ODOAPLMOJPD == 1 && __instance == LIPNHOMGGHF.FKANHDIMMBJ[8])
			{
				ringSize = __result;
			}
		}

		[HarmonyPatch(typeof(Scene_Match_Setup), "Update")]
		[HarmonyPostfix]
		private static void Scene_Match_Setup_Update(Scene_Match_Setup __instance)
		{
			if (World.location == __instance.oldArena && World.MNCIAPLCFDM() > 0f && ringSize.HasValue && World.ringShape > 0 && (Object)(object)World.gRing != (Object)null)
			{
				World.ringSize = ringSize.Value;
				World.KJKAGJNFCEG();
				GIMNNPMAKNJ.NALPMNNGKAE();
			}
		}

		[HarmonyPatch(typeof(World), "DBKOAJKLBIF")]
		[HarmonyPostfix]
		private static void World_DBKOAJKLBIF(int EJDHFNIJFHI)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (NAEEIFNFBBO.CBMHGKFFHJE != 1)
			{
				World.gRing.transform.localScale = new Vector3(16.67f * World.ringSize, 16.67f, 16.67f * World.ringSize);
			}
		}

		[HarmonyPatch(typeof(World), "BNIAGHOEDHA")]
		[HarmonyPrefix]
		private static void World_BNIAGHOEDHA()
		{
			if (NAEEIFNFBBO.CBMHGKFFHJE != 1 && ringSize.HasValue && World.ringSize != ringSize)
			{
				World.ringSize = ringSize.Value;
			}
		}
	}
}