Decompiled source of JojoMineTriggerSFX v1.0.0

JojoMineTrigger.dll

Decompiled 11 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using JojoMineTrigger.Patches;
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("JojoMineTrigger")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JojoMineTrigger")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("caf1eeaa-ea23-455c-b05d-393919cf1550")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace JojoMineTrigger
{
	[BepInPlugin("Ex.JojoMineTriggerSFXMod", "Ex Jojo Mine Trigger SFX Mod", "1.0.0")]
	public class JojoMineTriggerBase : BaseUnityPlugin
	{
		private const string modGUID = "Ex.JojoMineTriggerSFXMod";

		private const string modName = "Ex Jojo Mine Trigger SFX Mod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Ex.JojoMineTriggerSFXMod");

		private static JojoMineTriggerBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip newMineTriggerSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Ex.JojoMineTriggerSFXMod");
			mls.LogInfo((object)"Jojo Mine Trigger SFX mod has initiated");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "JojoMineTrigger.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "JojoMineSFX";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newMineTriggerSFX = val.LoadAsset<AudioClip>("Assets/OhNo.mp3");
			harmony.PatchAll(typeof(JojoMineTriggerBase));
			harmony.PatchAll(typeof(JojoMinePatch));
			mls.LogInfo((object)"This IS a Jojo reference.");
		}
	}
}
namespace JojoMineTrigger.Patches
{
	[HarmonyPatch(typeof(Landmine))]
	internal class JojoMinePatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void JojoMineSFXPatch(ref AudioClip ___mineTrigger)
		{
			___mineTrigger = JojoMineTriggerBase.newMineTriggerSFX;
		}
	}
}