Decompiled source of MineFart v1.1.3

MineFart.dll

Decompiled 5 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using MineFart.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("MineFart")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MineFart")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("62df1775-80b8-4c42-a2f8-57826a561d90")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MineFart
{
	[BepInPlugin("Skipeverything.LCMods", "MineFart", "1.1.1")]
	public class MineFart : BaseUnityPlugin
	{
		private const string modGUID = "Skipeverything.LCMods";

		private const string modName = "MineFart";

		private const string modVersion = "1.1.1";

		private readonly Harmony harmony = new Harmony("Skipeverything.LCMods");

		internal static MineFart Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> SoundFX;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Skipeverything.LCMods");
			mls.LogInfo((object)"MineFart has awoken!");
			harmony.PatchAll(typeof(MineDetonationPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("MineFart.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "fartclose");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogMessage((object)"Successfully loaded asset bundle!");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load asset bundle");
			}
		}
	}
}
namespace MineFart.Patches
{
	[HarmonyPatch(typeof(Landmine))]
	internal class MineDetonationPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(Landmine __instance)
		{
			__instance.mineDetonate = MineFart.SoundFX[0];
		}
	}
}