Decompiled source of ThumperSFX v1.1.0

ThumperSFX.dll

Decompiled 11 months 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 ThumperSFX.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("ThumperSFX")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ThumperSFX")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("82d07fcd-aad3-4391-af93-e7152362cb69")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ThumperSFX
{
	[BepInPlugin("Ex.ThumperSFXMod", "Ex Thumper SFX Mod", "1.0.0")]
	public class ThumperSFXBase : BaseUnityPlugin
	{
		private const string modGUID = "Ex.ThumperSFXMod";

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

		private const string modVersion = "1.0.0";

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

		private static ThumperSFXBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip newShortRoarSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Ex.ThumperSFXMod");
			mls.LogInfo((object)"Thumper SFX mod has initiated");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "ThumperSFX.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "ThumperSFX";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newShortRoarSFX = val.LoadAsset<AudioClip>("Assets/shihtzu.mp3");
			harmony.PatchAll(typeof(ThumperSFXBase));
			harmony.PatchAll(typeof(ThumperPatch));
			mls.LogInfo((object)"Thumper SFX mod has loaded.");
		}
	}
}
namespace ThumperSFX.Patches
{
	[HarmonyPatch(typeof(CrawlerAI))]
	internal class ThumperPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void ThumperSFXPatch(ref AudioClip ___shortRoar)
		{
			___shortRoar = ThumperSFXBase.newShortRoarSFX;
		}
	}
}