Decompiled source of BoombaJBLFettyWap v1.1.0

Boomba_Fetty_Audio.dll

Decompiled 5 days 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 LethalThings;
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("Boomba_Fetty_Audio")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Boomba_Fetty_Audio")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a647c134-23e8-4644-aa71-eb1a19c35a98")]
[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")]
[BepInPlugin("Langert.BoombaFettyMod", "BoombaFettyWapMod", "1.1.0")]
public class BoombaFettyMod : BaseUnityPlugin
{
	public const string modGUID = "Langert.BoombaFettyMod";

	public const string modName = "BoombaFettyWapMod";

	public const string modVersion = "1.1.0";

	private readonly Harmony harmony = new Harmony("Langert.BoombaFettyMod");

	private static BoombaFettyMod Instance;

	internal static ManualLogSource mls;

	internal static AudioClip[] SoundFX;

	internal static AssetBundle Bundle;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		mls = Logger.CreateLogSource("Langert.BoombaFettyMod");
		mls.LogMessage((object)"Langert.BoombaFettyMod has loaded succesfully.");
		harmony.PatchAll(typeof(BoombaFettyAudioPatch));
		mls = ((BaseUnityPlugin)this).Logger;
		List<AudioClip> list = new List<AudioClip>();
		string location = ((BaseUnityPlugin)Instance).Info.Location;
		location = location.TrimEnd("Boomba_Fetty_Audio.dll".ToCharArray());
		Bundle = AssetBundle.LoadFromFile(location + "boomba_fettywap");
		if ((Object)(object)Bundle != (Object)null)
		{
			list = Bundle.LoadAllAssets<AudioClip>().ToList();
			mls.LogInfo((object)"Successfully loaded AssetBundle.");
		}
		else
		{
			mls.LogError((object)"Failed to load AssetBundle.");
		}
		SoundFX = list.ToArray();
		mls.LogInfo((object)"Langert.BoombaFettyMod has loaded successfully.");
	}
}
[HarmonyPatch(typeof(RoombaAI))]
internal class BoombaFettyAudioPatch
{
	[HarmonyPatch("Update")]
	[HarmonyPatch("StartIdleAnimation")]
	[HarmonyPatch("DoAIInterval")]
	[HarmonyPatch("Start")]
	[HarmonyPostfix]
	private static void InvestigateAudioPatch(RoombaAI __instance)
	{
		AudioClip beepNoise = BoombaFettyMod.SoundFX[0];
		__instance.beepNoise = beepNoise;
	}
}