Decompiled source of BurgerKing Crown v1.0.1

Whopper.dll

Decompiled 5 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
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 Whopper.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Whopper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Whopper")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8396c560-5287-4da4-8413-4137d32e42b8")]
[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 Whopper
{
	[BepInPlugin("Charell.BurgerKing", "BurgerKing", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "Charell.BurgerKing";

		private const string modName = "BurgerKing";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Charell.BurgerKing");

		internal ManualLogSource mls;

		public static Plugin Instance;

		internal List<AudioClip> audioClips = new List<AudioClip>();

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Charell.BurgerKing");
			mls.LogError((object)"Plugin Successfully started!");
			harmony.PatchAll(typeof(Plugin));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "sounds");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			audioClips = val.LoadAllAssets<AudioClip>().ToList();
			foreach (AudioClip audioClip in audioClips)
			{
				if (((Object)audioClip).name.ToLower() == "whopper")
				{
					SFX.WhopperMusic = audioClip;
				}
			}
		}
	}
	public class SFX
	{
		public static AudioClip WhopperMusic;
	}
}
namespace Whopper.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(StartOfRound __instance)
		{
			__instance.shipIntroSpeechSFX = SFX.WhopperMusic;
		}
	}
}