Decompiled source of JudgementTime v1.0.0

doomahreal.ultrakill.JudgementTime/JudgementTime.dll

Decompiled a month 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 HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;

[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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("JudgementTime")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("JudgementTime")]
[assembly: AssemblyTitle("JudgementTime")]
[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 JudgementTime
{
	[BepInPlugin("doomahreal.ultrakill.JudgementTime", "JudgementTime", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static AudioClip minosPrimeClip;

		private async void Awake()
		{
			AsyncOperationHandle<AudioClip> handle = Addressables.LoadAssetAsync<AudioClip>((object)"Assets/Music/Bosses/Minos Prime.wav");
			await handle.Task;
			minosPrimeClip = handle.Result;
			Harmony harmony = new Harmony("doomahreal.ultrakill.JudgementTime");
			harmony.PatchAll();
			Debug.Log((object)"Prepare Thyself!");
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("Start")]
	public static class MinosPrime_Start_Patch
	{
		private static void Postfix(MinosPrime __instance)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Plugin.minosPrimeClip != (Object)null)
			{
				GameObject val = new GameObject("MinosPrimeAudio");
				val.transform.SetParent(((Component)__instance).transform);
				val.transform.localPosition = Vector3.zero;
				AudioSource val2 = val.AddComponent<AudioSource>();
				val2.clip = Plugin.minosPrimeClip;
				val2.loop = true;
				val2.spatialBlend = 1f;
				if ((Object)(object)val.GetComponent<AudioDistortionFilter>() == (Object)null)
				{
					val.AddComponent<AudioDistortionFilter>().distortionLevel = 1f;
				}
				if ((Object)(object)val.GetComponent<AudioLowPassFilter>() == (Object)null)
				{
					AudioLowPassFilter val3 = val.AddComponent<AudioLowPassFilter>();
					val3.lowpassResonanceQ = 0.2f;
				}
				val2.Play();
			}
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("Death")]
	public static class MinosPrime_Death_Patch
	{
		private static void Postfix(MinosPrime __instance)
		{
			GameObject val = GameObject.Find("MinosPrimeAudio");
			if ((Object)(object)val != (Object)null)
			{
				Object.Destroy((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("Boxing")]
	public static class MinosPrime_Boxing_Patch
	{
		private static bool Prefix(MinosPrime __instance)
		{
			__instance.Dropkick();
			return false;
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("Jump")]
	public static class MinosPrime_Jump_Patch
	{
		private static bool Prefix(MinosPrime __instance)
		{
			__instance.Dropkick();
			return false;
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("ProjectilePunch")]
	public static class MinosPrime_ProjectilePunch_Patch
	{
		private static bool Prefix(MinosPrime __instance)
		{
			__instance.Dropkick();
			return false;
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("Combo")]
	public static class MinosPrimeComboPatch
	{
		private static bool Prefix(MinosPrime __instance)
		{
			__instance.Dropkick();
			return false;
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("RiderKick")]
	public static class MinosPrimeRiderKickPatch
	{
		private static bool Prefix(MinosPrime __instance)
		{
			__instance.Dropkick();
			return false;
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("DropAttack")]
	public static class MinosPrimeDropAttackPatch
	{
		private static bool Prefix(MinosPrime __instance)
		{
			__instance.Dropkick();
			return false;
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("DownSwing")]
	public static class MinosPrimeDownSwingPatch
	{
		private static bool Prefix(MinosPrime __instance)
		{
			__instance.Dropkick();
			return false;
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("Uppercut")]
	public static class MinosPrimeUppercutPatch
	{
		private static bool Prefix(MinosPrime __instance)
		{
			__instance.Dropkick();
			return false;
		}
	}
	[HarmonyPatch(typeof(MinosPrime))]
	[HarmonyPatch("PickAttack")]
	public static class MinosPrime_PickAttack_Patch
	{
		private static bool Prefix(MinosPrime __instance, int type)
		{
			if (__instance.attacksSinceBoxing >= 5)
			{
				type = 0;
			}
			switch (type)
			{
			case 0:
				__instance.Dropkick();
				return false;
			case 1:
				__instance.Dropkick();
				return false;
			case 2:
				__instance.Dropkick();
				return false;
			case 3:
				__instance.Dropkick();
				return false;
			default:
				__instance.Dropkick();
				return false;
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "JudgementTime";

		public const string PLUGIN_NAME = "JudgementTime";

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