Decompiled source of AmongUsBracken v0.1.0

AmongUsBracken.dll

Decompiled 10 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 AmongUsBracken.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("AmongUsBracken")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AmongUsBracken")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("360EF4D7-D3CE-4130-9FB3-7B18A6B128C9")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AmongUsBracken
{
	[BepInPlugin("GhastCraftHD.AmongUsBracken", "AmongUsBracken", "0.1.0")]
	public class AmongUsBracken : BaseUnityPlugin
	{
		private const string modGUID = "GhastCraftHD.AmongUsBracken";

		private const string modName = "AmongUsBracken";

		private const string modVersion = "0.1.0";

		private readonly Harmony harmony = new Harmony("GhastCraftHD.AmongUsBracken");

		private static AmongUsBracken 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("GhastCraftHD.AmongUsBracken");
			mls.LogInfo((object)"AmongUsBracken was enabled");
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("AmongUsBracken.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "AmongUsBracken");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Loaded asset bundle successfully");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load asset bundle");
			}
			harmony.PatchAll(typeof(AmongUsBracken));
			harmony.PatchAll(typeof(FlowermanAIPatch));
		}
	}
}
namespace AmongUsBracken.Patches
{
	[HarmonyPatch(typeof(FlowermanAI))]
	internal class FlowermanAIPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(FlowermanAI __instance)
		{
			__instance.crackNeckSFX = AmongUsBracken.SoundFX[0];
		}
	}
}