Decompiled source of ThumperSteiner v1.0.0

ThumperSteiner.dll

Decompiled a year 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 ThumperSteiner.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("ThumperSteiner")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ThumperSteiner")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("555e2080-6909-4784-b378-9d516c3f8b53")]
[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 ThumperSteiner
{
	[BepInPlugin("Beneto.ThumperSteiner", "Thumper Steiner", "1.0.0")]
	public class ThumperSteinerBase : BaseUnityPlugin
	{
		private const string modGUID = "Beneto.ThumperSteiner";

		private const string modName = "Thumper Steiner";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Beneto.ThumperSteiner");

		private static ThumperSteinerBase 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("Beneto.ThumperSteiner");
			mls.LogInfo((object)"Thumper Steiner is Activated");
			harmony.PatchAll(typeof(ThumperSteinerBase));
			harmony.PatchAll(typeof(CrawlerAIPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("ThumperSteiner.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "steinervoicelines");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Successfully loaded asset bundle");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load asset bundle");
			}
		}
	}
}
namespace ThumperSteiner.Patches
{
	[HarmonyPatch(typeof(CrawlerAI))]
	internal class CrawlerAIPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(CrawlerAI __instance)
		{
			__instance.longRoarSFX = ThumperSteinerBase.SoundFX.ToArray();
			__instance.hitCrawlerSFX[0] = ThumperSteinerBase.SoundFX[9];
		}
	}
}