Decompiled source of ObamaBracken v1.0.1

ObamaBracken.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 ObamaBracken.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("ObamaBracken")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ObamaBracken")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("24b79d29-b60a-4611-ba76-c5b16b10203d")]
[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 ObamaBracken
{
	[BepInPlugin("ObamaTheThroatGoatFR", "ObamaBracken", "1.0.0")]
	public class ObamaModBase : BaseUnityPlugin
	{
		private const string modGUID = "ObamaTheThroatGoatFR";

		private const string modName = "ObamaBracken";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("ObamaTheThroatGoatFR");

		private static ObamaModBase 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("ObamaTheThroatGoatFR");
			mls.LogInfo((object)"Hello my fellow americans.");
			harmony.PatchAll(typeof(ObamaModBase));
			harmony.PatchAll(typeof(FlowermanPatch));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("ObamaBracken.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "bamahello");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Succeded to load asset bundle");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load assetbundle");
			}
		}
	}
}
namespace ObamaBracken.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class FlowermanPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(StartOfRound __instance)
		{
			__instance.shipIntroSpeechSFX = ObamaModBase.SoundFX[0];
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(StartOfRound __instance)
		{
			__instance.shipIntroSpeechSFX = ObamaModBase.SoundFX[0];
		}
	}
}