Decompiled source of CongregationBracken v1.0.0

LC_CongregationBracken.dll

Decompiled 7 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 UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LC_CongregationBracken")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LC_CongregationBracken")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b77ff511-ecae-4ef3-ac8b-cb478096b648")]
[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 LC_CongregationBracken.Patches;

[BepInPlugin("Jack.CongregationBracken", "Congregation Bracken", "1.0.0.0")]
public class CongregationBase : BaseUnityPlugin
{
	private const string modGUID = "Jack.CongregationBracken";

	private const string modName = "Congregation Bracken";

	private const string modVersion = "1.0.0.0";

	private readonly Harmony harmony = new Harmony("Jack.CongregationBracken");

	private static CongregationBase 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("Jack.CongregationBracken");
		mls.LogInfo((object)"Successfully loaded CongregationBracken ver.1.0.0.0");
		harmony.PatchAll(typeof(FlowermanAIPatch));
		SoundFX = new List<AudioClip>();
		string location = ((BaseUnityPlugin)Instance).Info.Location;
		location = location.TrimEnd("LC_CongregationBracken.dll".ToCharArray());
		Bundle = AssetBundle.LoadFromFile(location + "congregation");
		if ((Object)(object)Bundle != (Object)null)
		{
			mls.LogInfo((object)"SUCCESSFULLY loaded asset bundle");
			SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
		}
		else
		{
			mls.LogError((object)"ERROR occurred while loading asset bundle");
		}
	}
}
[HarmonyPatch(typeof(FlowermanAI))]
internal class FlowermanAIPatch
{
	[HarmonyPatch("Update")]
	[HarmonyPatch("KillEnemy")]
	[HarmonyPostfix]
	private static void brackenAudioPatch(FlowermanAI __instance)
	{
		__instance.creatureAngerVoice.clip = CongregationBase.SoundFX[0];
		__instance.crackNeckSFX = CongregationBase.SoundFX[1];
	}
}