Decompiled source of ISmellYouSFX v1.0.0

ISmellYou.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 ISmellYouSFX.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("ISmellYou")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ISmellYou")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c74e3086-234a-4811-ae0b-d49247942c27")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ISmellYouSFX
{
	[BepInPlugin("Ex.ISmellYouSFXMod", "Ex I Can Smell You SFX Mod", "1.0.0")]
	public class ISmellYouSFXBase : BaseUnityPlugin
	{
		private const string modGUID = "Ex.ISmellYouSFXMod";

		private const string modName = "Ex I Can Smell You SFX Mod";

		private const string modVersion = "1.0.0";

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

		private static ISmellYouSFXBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip newSmellYouSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Ex.ISmellYouSFXMod");
			mls.LogInfo((object)"I Can Smell You SFX mod has initiated");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "ISmellYou.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "ISmellYouSFX";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newSmellYouSFX = val.LoadAsset<AudioClip>("Assets/Morgan.mp3");
			harmony.PatchAll(typeof(ISmellYouSFXBase));
			harmony.PatchAll(typeof(ISmellYouPatch));
			mls.LogInfo((object)"I Can Smell You SFX mod has loaded.");
		}
	}
}
namespace ISmellYouSFX.Patches
{
	[HarmonyPatch(typeof(FlowermanAI))]
	internal class ISmellYouPatch
	{
		internal static AudioSource ISmellYouSFX;

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		public static void ISmellYouSFXPatch(FlowermanAI __instance)
		{
			__instance.creatureAngerVoice.PlayOneShot(ISmellYouSFXBase.newSmellYouSFX);
		}
	}
}