Decompiled source of AngryYattaBug v1.0.2

LCModTest.dll

Decompiled 4 days 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 LCModTest.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("LCModTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LCModTest")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("26671b60-35c8-48fa-9fce-0887e10771ef")]
[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 LCModTest
{
	[BepInPlugin("Oreowich.LCModTest", "LC Mod Test", "1.0.0.0")]
	public class ModBase : BaseUnityPlugin
	{
		private const string modGUID = "Oreowich.LCModTest";

		private const string modName = "LC Mod Test";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("Oreowich.LCModTest");

		private static ModBase 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("Oreowich.LCModTest");
			mls.LogInfo((object)"The test mod has awaken :");
			harmony.PatchAll(typeof(ModBase));
			harmony.PatchAll(typeof(HoarderBugPatch));
			harmony.PatchAll(typeof(ShipPatch));
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("LCModTest.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "yattasound");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Sucessfully loaded asset bundle YATTTAA!");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load asset bundle :/");
			}
		}
	}
}
namespace LCModTest.Patches
{
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class HoarderBugPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void hoarderBugAudioPatch(HoarderBugAI __instance)
		{
			__instance.angryVoiceSFX = ModBase.SoundFX[0];
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class ShipPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void shipAudioPatch(StartOfRound __instance)
		{
			__instance.shipIntroSpeechSFX = ModBase.SoundFX[0];
		}
	}
}