Decompiled source of AISongebobLootBug v1.0.0

AISpongebobLootBug.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using AISpongebobLootBug.Patches;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
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("AISpongebobLootBug")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AISpongebobLootBug")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1e66f80b-155d-4f1c-ae0d-cb7cfd3ac60a")]
[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 AISpongebobLootBug
{
	[BepInPlugin("rainbowsludge.AISpongebobLootBug", "AI Spongebob Loot Bug", "1.0.0")]
	public class AISpongebobAudioSwap : BaseUnityPlugin
	{
		public const string pluginGuid = "rainbowsludge.AISpongebobLootBug";

		public const string pluginName = "AI Spongebob Loot Bug";

		public const string pluginVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("rainbowsludge.AISpongebobLootBug");

		private static AISpongebobAudioSwap instance;

		internal ManualLogSource mls;

		internal static AudioClip[] newSFX;

		public void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			mls = Logger.CreateLogSource("rainbowsludge.AISpongebobLootBug");
			mls.LogInfo((object)"rainbowsludge.AISpongebob is loading.");
			string location = ((BaseUnityPlugin)instance).Info.Location;
			string text = "AISpongebobLootBug.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "spongebobrap";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newSFX = val.LoadAssetWithSubAssets<AudioClip>("assets/stonefacedkiller.mp3");
			harmony.PatchAll(typeof(HoarderBugPatch));
			mls.LogInfo((object)"rainbowsludge.AISpongebobLootBug is loaded. Meow, meow, meow.");
		}
	}
}
namespace AISpongebobLootBug.Patches
{
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class HoarderBugPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void hoarderBugAudioPatch(ref AudioClip[] ___chitterSFX)
		{
			AudioClip[] newSFX = AISpongebobAudioSwap.newSFX;
			___chitterSFX = newSFX;
		}
	}
}