Decompiled source of JesterChaseSongMyWayFrankSinatra v1.0.1

LethalCompanyMyWay.dll

Decompiled a year ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using LethalCompanyMyWay.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("LethalCompanyMyWay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LethalCompanyMyWay")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c025f388-d11a-4e05-9ff1-a5bae4fdca60")]
[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 LethalCompanyMyWay
{
	[BepInPlugin("Juny.MyWay", "Jester My Way Chase Song", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "Juny.MyWay";

		private const string modName = "Jester My Way Chase Song";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Juny.MyWay");

		private static Plugin Instance;

		public static AudioClip myWayAudioClip;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(directoryName, "myway"));
			Debug.Log((object)$"assetBundle: {val}");
			myWayAudioClip = val.LoadAsset<AudioClip>("MyWayLethalCompany");
			if (Object.op_Implicit((Object)(object)myWayAudioClip))
			{
				Debug.Log((object)"[MyWayJester] - Successfully loaded audio file");
			}
			else
			{
				Debug.LogError((object)"[MyWayJester] = Failed to load audio file");
			}
			harmony.PatchAll(typeof(Plugin));
			harmony.PatchAll(typeof(JesterAIPatch));
		}
	}
}
namespace LethalCompanyMyWay.Patches
{
	[HarmonyPatch]
	internal class JesterAIPatch
	{
		[HarmonyPatch(typeof(JesterAI), "SetJesterInitialValues")]
		[HarmonyPostfix]
		public static void JesterStartPatch(ref AudioClip ___screamingSFX)
		{
			if (Object.op_Implicit((Object)(object)Plugin.myWayAudioClip))
			{
				___screamingSFX = Plugin.myWayAudioClip;
			}
		}
	}
}