Decompiled source of LethalBruh v1.1.1

LethalBruh/LethalBruh.dll

Decompiled 2 years ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalBruh.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("LethalBruh")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LethalBruh")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c2705749-2ab7-4371-a312-cd574983d7a0")]
[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 LethalBruh
{
	[BepInPlugin("CouncilOfBruh.LB", "Lethal Bruh LC Mod", "1.1.0")]
	public class LethalBruhModBase : BaseUnityPlugin
	{
		private const string modGUID = "CouncilOfBruh.LB";

		private const string modName = "Lethal Bruh LC Mod";

		private const string modVersion = "1.1.0";

		private readonly Harmony harmony = new Harmony("CouncilOfBruh.LB");

		private static LethalBruhModBase Instance;

		internal ManualLogSource MLS;

		internal static AudioClip[] popUpSFX;

		internal static AudioClip[] screamSFX;

		private void Awake()
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			MLS = Logger.CreateLogSource("CouncilOfBruh.LB");
			MLS.LogInfo((object)"Loading Lethal Bruh Mod.");
			MLS.LogInfo((object)"\r\n.__          __  .__           .__    ___.               .__     \r\n|  |   _____/  |_|  |__ _____  |  |   \\_ |_________ __ __|  |__  \r\n|  | _/ __ \\   __\\  |  \\\\__  \\ |  |    | __ \\_  __ \\  |  \\  |  \\ \r\n|  |_\\  ___/|  | |   Y  \\/ __ \\|  |__  | \\_\\ \\  | \\/  |  /   Y  \\\r\n|____/\\___  >__| |___|  (____  /____/  |___  /__|  |____/|___|  /\r\n          \\/          \\/     \\/            \\/                 \\/ \r\n");
			harmony.PatchAll(typeof(PlayerControllerBPatch));
			AssetBundle val = AssetBundle.LoadFromFile(((BaseUnityPlugin)Instance).Info.Location.TrimEnd("LethalBruh.dll".ToCharArray()) + "jestersfx");
			if ((Object)val == (Object)null || (Object)val == (Object)null)
			{
				MLS.LogError((object)"Failed to load audio asset for Jester Free Bird TOTEM Remix Theme!");
				return;
			}
			popUpSFX = val.LoadAssetWithSubAssets<AudioClip>("assets/freebird1.mp3");
			screamSFX = val.LoadAssetWithSubAssets<AudioClip>("assets/freebird2.mp3");
			harmony.PatchAll(typeof(JesterAIPatch));
			MLS.LogInfo((object)"Lethal Bruh Mod loaded. Press ESC if the game is frozen occasionally.");
			MLS.LogInfo((object)"Beware of any Nevzat activities.");
			harmony.PatchAll(typeof(LethalBruhModBase));
		}
	}
}
namespace LethalBruh.Patches
{
	[HarmonyPatch(typeof(JesterAI))]
	internal class JesterAIPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		public static void JesterAIPopUpSFXPatch(ref AudioClip ___popGoesTheWeaselTheme)
		{
			AudioClip[] popUpSFX = LethalBruhModBase.popUpSFX;
			if (popUpSFX != null && popUpSFX.Length != 0)
			{
				AudioClip val = popUpSFX[0];
				___popGoesTheWeaselTheme = val;
			}
		}

		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		public static void JesterAIScreamSFXPatch(ref AudioClip ___screamingSFX)
		{
			AudioClip[] screamSFX = LethalBruhModBase.screamSFX;
			if (screamSFX != null && screamSFX.Length != 0)
			{
				AudioClip val = screamSFX[0];
				___screamingSFX = val;
			}
		}

		[HarmonyPatch("SetJesterInitialValues")]
		[HarmonyPostfix]
		public static void JestAIInitialPatch(ref float ___popUpTimer)
		{
			___popUpTimer = 35f;
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("LateUpdate")]
		[HarmonyPrefix]
		private static void LongerSprintPatch(ref float ___sprintTime)
		{
			___sprintTime = 20f;
		}
	}
}