Decompiled source of FreddyFazbearDeadTeammateNoise v1.0.0

Freddy_Deady.dll

Decompiled 9 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Freddy_Deady.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("Freddy_Deady")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Freddy_Deady")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a6334a32-1742-4523-ac97-87500085b9e8")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Freddy_Deady
{
	[BepInPlugin("sadboi.freddydeadymod", "Freddy Fazbear Dead Teammate Noise", "1.0.0.0")]
	public class FreddyDeadyBase : BaseUnityPlugin
	{
		private const string modGUID = "sadboi.freddydeadymod";

		private const string modName = "Freddy Fazbear Dead Teammate Noise";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("sadboi.freddydeadymod");

		private static FreddyDeadyBase Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> SoundFX;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("mod are awake");
			mls.LogInfo((object)"message on mod load");
			harmony.PatchAll(typeof(FreddyDeadyBase));
			harmony.PatchAll(typeof(SoundManagerPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("Freddy_Deady.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "freggy");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"yeah we gucci");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"it didn't work");
			}
		}
	}
}
namespace Freddy_Deady.Patches
{
	[HarmonyPatch(typeof(SoundManager))]
	internal class SoundManagerPatch
	{
		[HarmonyPatch("SetFearAudio")]
		[HarmonyPostfix]
		private static void OverrideAudio(SoundManager __instance)
		{
			__instance.highAction1.PlayOneShot(FreddyDeadyBase.SoundFX[0]);
			__instance.highAction2.PlayOneShot(FreddyDeadyBase.SoundFX[0]);
			__instance.lowAction.PlayOneShot(FreddyDeadyBase.SoundFX[0]);
		}
	}
}