Decompiled source of MouthDogSFX v2.0.0

MouthDog.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 MouthDogSFX.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("MouthDog")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MouthDog")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6453d978-fa44-4b8b-8dbf-3cf68ebddc58")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MouthDogSFX
{
	[BepInPlugin("Ex.MouthDogSFXMod", "Ex Eyeless Dog SFX Mod", "1.0.0")]
	public class MouthDogSFXBase : BaseUnityPlugin
	{
		private const string modGUID = "Ex.MouthDogSFXMod";

		private const string modName = "Ex Eyeless Dog SFX Mod";

		private const string modVersion = "1.0.0";

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

		private static MouthDogSFXBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip newKillPlayerSFX;

		internal static AudioClip newScreamSFX;

		internal static AudioClip newBreathingSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Ex.MouthDogSFXMod");
			mls.LogInfo((object)"MouthDog has initiated");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "MouthDog.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "MouthDogSFX";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newScreamSFX = val.LoadAsset<AudioClip>("Assets/UwuSound.mp3");
			newKillPlayerSFX = val.LoadAsset<AudioClip>("Assets/Squeaky2.mp3");
			newBreathingSFX = val.LoadAsset<AudioClip>("Assets/flush.mp3");
			harmony.PatchAll(typeof(MouthDogSFXBase));
			harmony.PatchAll(typeof(killPlayerPatch));
			harmony.PatchAll(typeof(ScreamPatch));
			harmony.PatchAll(typeof(BreathingPatch));
			mls.LogInfo((object)"MouthDog SFX mod has loaded.");
		}
	}
}
namespace MouthDogSFX.Patches
{
	[HarmonyPatch(typeof(MouthDogAI))]
	internal class BreathingPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void BreathingSFXPatch(ref AudioClip ___breathingSFX)
		{
			___breathingSFX = MouthDogSFXBase.newBreathingSFX;
		}
	}
	[HarmonyPatch(typeof(MouthDogAI))]
	internal class ScreamPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void ScreamSFXPatch(ref AudioClip ___screamSFX)
		{
			___screamSFX = MouthDogSFXBase.newScreamSFX;
		}
	}
	[HarmonyPatch(typeof(MouthDogAI))]
	internal class killPlayerPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void killPlayerSFXPatch(ref AudioClip ___killPlayerSFX)
		{
			___killPlayerSFX = MouthDogSFXBase.newKillPlayerSFX;
		}
	}
}