using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using RobustProgramRandomness.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("RobustProgramRandomness")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RobustProgramRandomness")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("33520ce5-690d-4a9f-92a5-614932d1f349")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RobustProgramRandomness
{
[BepInPlugin("Robustprogram.RobustProgramRandomness", "RobustProgramRandomness", "0.0.1")]
public class RandomnessMod : BaseUnityPlugin
{
private const string modGUID = "Robustprogram.RobustProgramRandomness";
private const string modName = "RobustProgramRandomness";
private const string modVersion = "0.0.1";
private readonly Harmony harmony = new Harmony("Robustprogram.RobustProgramRandomness");
private static RandomnessMod Instance;
internal ManualLogSource mls;
internal static AudioClip[] hoarderBugSFX;
internal static AudioClip[] springmanSFX;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("Robustprogram.RobustProgramRandomness");
mls.LogInfo((object)"You activated my trap card");
string location = ((BaseUnityPlugin)Instance).Info.Location;
string text = "RobustProgramRandomness.dll";
string text2 = location.TrimEnd(text.ToCharArray());
string text3 = text2 + "fuckonthebus";
AssetBundle val = AssetBundle.LoadFromFile(text3);
if ((Object)(object)val == (Object)null)
{
mls.LogError((object)"Failed to load assets :(");
return;
}
hoarderBugSFX = val.LoadAllAssets<AudioClip>();
mls.LogInfo((object)hoarderBugSFX.ToString());
mls.LogInfo((object)hoarderBugSFX.Length);
harmony.PatchAll(typeof(HoarderSoundPatch));
mls.LogInfo((object)"My mod is loaded :D");
}
}
}
namespace RobustProgramRandomness.patches
{
[HarmonyPatch(typeof(HoarderBugAI))]
internal class HoarderSoundPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
public static void hoarderBugAudioPatch(ref AudioClip[] ___chitterSFX)
{
___chitterSFX = RandomnessMod.hoarderBugSFX;
}
}
[HarmonyPatch(typeof(SpringManAI))]
internal class MichaelJacksonPatch
{
[HarmonyPatch("__initializeVariables")]
[HarmonyPostfix]
public static void makeHimMichaelJackson(ref AudioClip[] ___springNoises)
{
___springNoises = RandomnessMod.springmanSFX;
}
}
}