Decompiled source of byeah v1.0.0

byeah.dll

Decompiled 17 hours 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 UnityEngine;
using byeah.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("byeah")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("byeah")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("56055636-a6c3-4db4-a0a9-c3752bea4793")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace byeah
{
	[BepInPlugin("Golderdink.byeah", "byeah sound for Bracken", "1.0.0")]
	public class ByeahBase : BaseUnityPlugin
	{
		private const string modGUID = "Golderdink.byeah";

		private const string modName = "byeah sound for Bracken";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Golderdink.byeah");

		private static ByeahBase Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> byeahSFX;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			if ((Object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Golderdink.byeah");
			mls.LogInfo((object)"loading byeah :)");
			harmony.PatchAll(typeof(ByeahBase));
			harmony.PatchAll(typeof(ByeahPatch));
			Bundle = AssetBundle.LoadFromFile(((BaseUnityPlugin)Instance).Info.Location.TrimEnd("byeah.dll".ToCharArray()) + "byeahbundle");
			if ((Object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"byeah for Bracken Mod Loaded");
				byeahSFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"byeah for Bracken failed to load");
			}
		}
	}
}
namespace byeah.Patches
{
	[HarmonyPatch(typeof(FlowermanAI))]
	internal class ByeahPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		public static void FlowermanAICrackNeckSFXPatch(FlowermanAI __instance)
		{
			__instance.crackNeckSFX = ByeahBase.byeahSFX[0];
		}
	}
}