Decompiled source of EmpsWallSFX v1.0.0

EmpsWallAttack.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 EmpsWallAttack.Patches;
using HarmonyLib;
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("EmpsWallAttack")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EmpsWallAttack")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d0c06386-993d-424c-8366-68574df9314e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace EmpsWallAttack
{
	[BepInPlugin("Ex.EmpsWallSFXMod", "Ex Emps TTS Wall Attack SFX Mod", "1.0.0")]
	public class EmpsWallAttackBase : BaseUnityPlugin
	{
		private const string modGUID = "Ex.EmpsWallSFXMod";

		private const string modName = "Ex Emps TTS Wall Attack SFX Mod";

		private const string modVersion = "1.0.0";

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

		private static EmpsWallAttackBase Instance;

		internal ManualLogSource mls;

		internal static AudioClip newWallAttackSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Ex.EmpsWallSFXMod");
			mls.LogInfo((object)"Emps TTS Wall Attack SFX mod has initiated");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "EmpsWallAttack.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "EmpsWallSFX";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newWallAttackSFX = val.LoadAsset<AudioClip>("Assets/Livid.mp3");
			harmony.PatchAll(typeof(EmpsWallAttackBase));
			harmony.PatchAll(typeof(EmpsWallPatch));
			mls.LogInfo((object)"Give him his centurion.");
		}
	}
}
namespace EmpsWallAttack.Patches
{
	[HarmonyPatch(typeof(DepositItemsDesk))]
	internal class EmpsWallPatch
	{
		[HarmonyPatch("MakeLoudNoise")]
		[HarmonyPostfix]
		public static void EmpsTTSWallPatch(DepositItemsDesk __instance)
		{
			__instance.wallAudio.PlayOneShot(EmpsWallAttackBase.newWallAttackSFX);
		}
	}
}