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 Bracken_.Patches;
using GameNetcodeStuff;
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("Bracken+")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP")]
[assembly: AssemblyProduct("Bracken+")]
[assembly: AssemblyCopyright("Copyright © HP 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7e6ebc3d-10bc-455d-8f3d-f2ef428da16a")]
[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 Bracken_
{
[BepInPlugin("NickBracken", "Bracken+", "1.0.0.0")]
public class BrackenBase : BaseUnityPlugin
{
private const string modGUID = "NickBracken";
private const string modName = "Bracken+";
private const string modVersion = "1.0.0.0";
private readonly Harmony harmony = new Harmony("NickBracken");
private static BrackenBase 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("NickBracken");
mls.LogInfo((object)"Started");
harmony.PatchAll(typeof(BrackenBase));
harmony.PatchAll(typeof(JesterWindPatch));
harmony.PatchAll(typeof(JesterPatch));
mls = ((BaseUnityPlugin)this).Logger;
SoundFX = new List<AudioClip>();
string location = ((BaseUnityPlugin)Instance).Info.Location;
location = location.TrimEnd("Bracken+.dll".ToCharArray());
Bundle = AssetBundle.LoadFromFile(location + "rick");
if ((Object)(object)Bundle != (Object)null)
{
mls.LogInfo((object)"Successfully loaded asset bundle");
SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
}
else
{
mls.LogError((object)"Failed to load asset bundle");
}
}
}
}
namespace Bracken_.Patches
{
[HarmonyPatch(typeof(JesterAI))]
internal class JesterPatch
{
[HarmonyPatch("Update")]
[HarmonyPostfix]
private static void OverrideAudio(JesterAI __instance)
{
__instance.popGoesTheWeaselTheme = BrackenBase.SoundFX[0];
}
}
[HarmonyPatch(typeof(StartOfRound))]
internal class JesterWindPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void OverrideAudio(StartOfRound __instance)
{
__instance.shipIntroSpeechSFX = BrackenBase.SoundFX[0];
}
}
[HarmonyPatch(typeof(PlayerControllerB))]
internal class PlayerControllerBPatch
{
[HarmonyPatch("Update")]
[HarmonyPostfix]
private static void patchUpdate(ref float ___sprintMeter)
{
___sprintMeter = 1f;
}
private static void patchUpdateWeight(PlayerControllerB __instance)
{
__instance.carryWeight = 0f;
__instance.climbSpeed = 10f;
}
}
}