Decompiled source of FuniDogs v1.1.0

FuniDogs.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 FuniDogs.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("FuniDogs")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FuniDogs")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("eed8de11-1c99-4583-a864-866e2f4aa9da")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FuniDogs
{
	[BepInPlugin("RoroMods.FuniDogs", "FuniDogs", "1.1.0")]
	public class FuniDogsBase : BaseUnityPlugin
	{
		private const string modGUID = "RoroMods.FuniDogs";

		private const string modName = "FuniDogs";

		private const string modVersion = "1.1.0";

		private readonly Harmony harmony = new Harmony("RoroMods.FuniDogs");

		private static FuniDogsBase Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> SoundFX;

		internal static List<AudioClip> SoundFX2;

		internal static AssetBundle Bundle1;

		internal static AssetBundle Bundle2;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("RoroMods.FuniDogs");
			mls.LogInfo((object)"Meme Dogzzzz");
			harmony.PatchAll(typeof(FuniDogsBase));
			harmony.PatchAll(typeof(MouthDogAIPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			SoundFX2 = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("FuniDogs.dll".ToCharArray());
			Bundle1 = AssetBundle.LoadFromFile(location + "icansmellya");
			Bundle2 = AssetBundle.LoadFromFile(location + "nom");
			if ((Object)(object)Bundle1 != (Object)null && (Object)(object)Bundle2 != (Object)null)
			{
				SoundFX = Bundle1.LoadAllAssets<AudioClip>().ToList();
				SoundFX2 = Bundle2.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load FuniDog's sounds. Please retry downloading!");
			}
		}
	}
}
namespace FuniDogs.Patches
{
	[HarmonyPatch(typeof(MouthDogAI))]
	internal class MouthDogAIPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(MouthDogAI __instance)
		{
			__instance.screamSFX = FuniDogsBase.SoundFX[0];
			__instance.killPlayerSFX = FuniDogsBase.SoundFX2[0];
		}
	}
}