Decompiled source of DeepTurkishWebBug v1.0.0

talkingBugMod1.dll

Decompiled 5 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 talkingBugMod1.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("talkingBugMod1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("talkingBugMod1")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4305f9b9-57da-4367-8cf6-a2943be55082")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace talkingBugMod1
{
	[BepInPlugin("Poseidon.talkingBugMod1", "M.Sarigul Bug Mod", "1.0.0")]
	public class Class1 : BaseUnityPlugin
	{
		private const string modGUID = "Poseidon.talkingBugMod1";

		private const string modName = "M.Sarigul Bug Mod";

		private const string modVersion = "1.0.0";

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

		private static Class1 Instance;

		internal static 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.talkingBugMod1");
			mls.LogInfo((object)"The tost mod has awaken :) ");
			harmony.PatchAll(typeof(Class1));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("talkingBugMod1.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "deepturkish");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Succesfully loaded asset bundle");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load asset bundle");
			}
		}
	}
}
namespace talkingBugMod1.Patches
{
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(HoarderBugAI __instance)
		{
			__instance.chitterSFX = Class1.SoundFX.ToArray();
			__instance.bugFlySFX = Class1.SoundFX[3];
		}
	}
}