Decompiled source of MantiCoilSFX v1.1.0

MantiCoil.dll

Decompiled a year ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using MantiCoil.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("MantiCoil")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MantiCoil")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("82757c29-8370-4c3b-a37c-7014fd22ba7a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MantiCoil
{
	[BepInPlugin("Ex.DoublewingSFXMod", "Ex MantiCoil SFX Mod", "1.0.0")]
	public class MantiCoilSFXBase : BaseUnityPlugin
	{
		private const string modGUID = "Ex.DoublewingSFXMod";

		private const string modName = "Ex MantiCoil SFX Mod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Ex.DoublewingSFXMod");

		private static MantiCoilSFXBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip[] newScreechSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Ex.DoublewingSFXMod");
			mls.LogInfo((object)"MantiCoil SFX mod has initiated");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "MantiCoil.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "MantiCoilSFX";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newScreechSFX = val.LoadAssetWithSubAssets<AudioClip>("Assets/Shaft.mp3");
			harmony.PatchAll(typeof(MantiCoilSFXBase));
			harmony.PatchAll(typeof(BirdScreechPatch));
			mls.LogInfo((object)"MantiCoil SFX mod has loaded.");
		}
	}
}
namespace MantiCoil.Patches
{
	[HarmonyPatch(typeof(DoublewingAI))]
	internal class BirdScreechPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void BirdScreechSFXPatch(ref AudioClip[] ___birdScreechSFX)
		{
			___birdScreechSFX = MantiCoilSFXBase.newScreechSFX;
		}
	}
}