Decompiled source of WHO LET THE DOGS OUT v1.0.3

BepInEx/plugins/dog.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 UnityEngine;
using dog.Pathes;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("dog")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("dog")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7543d7e1-7096-4b4d-9926-27e6f5ad370c")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace dog
{
	[BepInPlugin("CbrovkinMods.WHO_LET_THE_DOGS_OUT", "WHO LET THE DOGS OUT", "1.0.0")]
	public class WHO_LET_THE_DOGS_OUT : BaseUnityPlugin
	{
		private const string modGUID = "CbrovkinMods.WHO_LET_THE_DOGS_OUT";

		private const string modName = "WHO LET THE DOGS OUT";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("CbrovkinMods.WHO_LET_THE_DOGS_OUT");

		private static WHO_LET_THE_DOGS_OUT 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("CbrovkinMods.WHO_LET_THE_DOGS_OUT");
			mls.LogInfo((object)"WHO LET THE DOGS OUT?!");
			harmony.PatchAll(typeof(MouthDogAIPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("wltdo.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "dog");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Asset bundle loaded successfully");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load asset bundle");
			}
		}
	}
}
namespace dog.Pathes
{
	[HarmonyPatch(typeof(MouthDogAI))]
	internal class MouthDogAIPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void OverrideAudio(MouthDogAI __instance)
		{
			__instance.screamSFX = WHO_LET_THE_DOGS_OUT.SoundFX[0];
		}
	}
}