Decompiled source of PufferAEUGH v1.0.0

BepInEx/plugins/PufferAeugh/PampuchaDzwiek.dll

Decompiled 11 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 HarmonyLib;
using PampuchaDzwiek.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("PampuchaDzwiek")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PampuchaDzwiek")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1b1c745a-0e0e-47dd-996e-6040a4d5d49b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace PampuchaDzwiek
{
	[BepInPlugin("Poseidon.PufferModAEUGH", "PufferAeughMod", "1.0.0")]
	public class PampuchaBaseD : BaseUnityPlugin
	{
		private const string modGUID = "Poseidon.PufferModAEUGH";

		private const string modName = "PufferAeughMod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Poseidon.PufferModAEUGH");

		private static PampuchaBaseD 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("Poseidon.PufferModAEUGH");
			mls.LogInfo((object)"\r\n           ______ _    _  _____ _    _ \r\n     /\\   |  ____| |  | |/ ____| |  | |\r\n    /  \\  | |__  | |  | | |  __| |__| |\r\n   / /\\ \\ |  __| | |  | | | |_ |  __  |\r\n  / ____ \\| |____| |__| | |__| | |  | |\r\n /_/    \\_\\______|\\____/ \\_____|_|  |_|\r\n                                       \r\n                                       \r\n");
			harmony.PatchAll(typeof(PampuchaBaseD));
			harmony.PatchAll(typeof(PufferAIPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("PampuchaDzwiek.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "pampuh");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"asset bundle loaded");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"asset bundle not found");
			}
		}
	}
}
namespace PampuchaDzwiek.Patches
{
	[HarmonyPatch(typeof(PufferAI))]
	public class PufferAIPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(PufferAI __instance)
		{
			__instance.frightenSFX[0] = PampuchaBaseD.SoundFX[0];
			__instance.frightenSFX[1] = PampuchaBaseD.SoundFX[0];
		}
	}
}