Decompiled source of AngryYattaBug v1.0.3

LCModTest.dll

Decompiled 2 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 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("YATTAMOD.LCModTest", "Yatta Bug Mod", "1.0.0.0")]
	public class ModBase : BaseUnityPlugin
	{
		private const string modGUID = "YATTAMOD.LCModTest";

		private const string modName = "Yatta Bug Mod";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("YATTAMOD.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("YATTAMOD.LCModTest");
			mls.LogInfo((object)"The YATTA mod has awaken :");
			harmony.PatchAll(typeof(ModBase));
			harmony.PatchAll(typeof(HoarderYattaBugPatch));
			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 HoarderYattaBugPatch
	{
		[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];
		}
	}
}