Decompiled source of BenderHoardingBugMod v1.2.0

BenderHoardingBugMod.dll

Decompiled 7 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BenderHoardingBugMod;
using BenderHoardingBugMod.Patches;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
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("BenderHoardingBugMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BenderHoardingBugMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("76fa27cb-ed30-49c4-aa59-b2f896adb68c")]
[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")]
[HarmonyPatch(typeof(Shovel), "reelUpShovel")]
internal class ShovelPatch
{
	[HarmonyPrefix]
	private static void hitSFXPatch(Shovel __instance)
	{
		__instance.hitSFX = (AudioClip[])(object)new AudioClip[1] { BenderHoardingBugBase.newHitSfx };
		__instance.reelUp = BenderHoardingBugBase.newReelSfx;
	}
}
namespace BenderHoardingBugMod
{
	[BepInPlugin("Trippy.BHBMod", "Bender Hoarding Bug Mod", "1.1.0.0")]
	public class BenderHoardingBugBase : BaseUnityPlugin
	{
		private const string modGUID = "Trippy.BHBMod";

		private const string modName = "Bender Hoarding Bug Mod";

		private const string modVersion = "1.1.0.0";

		private readonly Harmony harmony = new Harmony("Trippy.BHBMod");

		internal static BenderHoardingBugBase Instance;

		internal static ManualLogSource mls;

		internal static AudioClip newSFX;

		internal static AudioClip newScreechSFX;

		internal static AudioClip newangryVoiceSFX;

		internal static AudioClip newbugFlySFX;

		internal static AudioClip newhitPlayerSFX;

		internal static AudioClip newHitSfx;

		internal static AudioClip newReelSfx;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Trippy.BHBMod");
			mls.LogInfo((object)"BenderBug is loading.");
			harmony.PatchAll(typeof(HoarderBugPatch));
			harmony.PatchAll(typeof(ShovelPatch));
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string location2 = ((BaseUnityPlugin)Instance).Info.Location;
			location2 = location2.TrimEnd("BenderHoardingBugMod.dll".ToCharArray());
			string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "hoardingbugbendermod");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			if ((Object)(object)val != (Object)null)
			{
				mls.LogInfo((object)"Successfully loaded audio assets!");
				newSFX = val.LoadAsset<AudioClip>("assets/Futurama - I love stealing, I love taking things.mp3");
				mls.LogInfo((object)"BenderBug has loaded, Time to bend some girders!!!");
				newScreechSFX = val.LoadAsset<AudioClip>("assets/Biteass.mp3");
				mls.LogInfo((object)"Bite my shiny metal ass!");
				newangryVoiceSFX = val.LoadAsset<AudioClip>("assets/Bendervoice.mp3");
				mls.LogInfo((object)"I'm 40% scrap!");
				newbugFlySFX = val.LoadAsset<AudioClip>("assets/Bendersong.mp3");
				mls.LogInfo((object)"B-E-N-D-E-R BENNNNDER!");
				newhitPlayerSFX = val.LoadAsset<AudioClip>("assets/Benderhit.mp3");
				mls.LogInfo((object)"KILL ALL HUMANS");
				newHitSfx = val.LoadAsset<AudioClip>("assets/MomSlap.mp3");
				newReelSfx = val.LoadAsset<AudioClip>("assets/JamBastard.mp3");
				mls.LogInfo((object)"Thank you for choosing MomCorp™ :) We always provide the best in technology <3");
				harmony.PatchAll(typeof(ShovelPatch));
				mls.LogInfo((object)"Executed Patch");
				mls.LogInfo((object)"MomCorp™ Shovel now available!!");
				if ((Object)(object)val == (Object)null)
				{
					mls.LogError((object)"Failed to load audio assets!");
				}
			}
		}
	}
}
namespace BenderHoardingBugMod.Patches
{
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class HoarderBugPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void HoarderBugAudioPatch(HoarderBugAI __instance)
		{
			__instance.chitterSFX = (AudioClip[])(object)new AudioClip[1] { BenderHoardingBugBase.newSFX };
			__instance.angryScreechSFX = (AudioClip[])(object)new AudioClip[1] { BenderHoardingBugBase.newScreechSFX };
			__instance.angryVoiceSFX = BenderHoardingBugBase.newangryVoiceSFX;
			__instance.bugFlySFX = BenderHoardingBugBase.newbugFlySFX;
			__instance.hitPlayerSFX = BenderHoardingBugBase.newhitPlayerSFX;
		}
	}
}