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 PipupupuMod.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("PipupupuMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PipupupuMod")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9f3bd024-2575-4a7d-9b5f-78d1b211b05a")]
[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 PipupupuMod
{
[BepInPlugin("HappyVVlnaJle.PipupupuMod", "Mizuki Mori 'Pipupupu' mod", "1.0.0")]
public class PipupupuModBase : BaseUnityPlugin
{
private const string modGUID = "HappyVVlnaJle.PipupupuMod";
private const string modName = "Mizuki Mori 'Pipupupu' mod";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("HappyVVlnaJle.PipupupuMod");
private static PipupupuModBase instance;
internal ManualLogSource mls;
internal static AudioClip[] bugSFX;
private void Awake()
{
if ((Object)(object)instance == (Object)null)
{
instance = this;
}
mls = Logger.CreateLogSource("HappyVVlnaJle.PipupupuMod");
mls.LogInfo((object)"HappyVVlnaJle.PipupupuMod is loading");
string location = ((BaseUnityPlugin)instance).Info.Location;
string text = "PipupupuMod.dll";
string text2 = location.TrimEnd(text.ToCharArray());
string text3 = text2 + "pipupupusound";
AssetBundle val = AssetBundle.LoadFromFile(text3);
if ((Object)(object)val == (Object)null)
{
mls.LogError((object)"Failed to load audio assets!");
}
else
{
string[] allAssetNames = val.GetAllAssetNames();
string[] array = allAssetNames;
foreach (string text4 in array)
{
mls.LogInfo((object)(text4 + " asset names"));
}
bugSFX = val.LoadAssetWithSubAssets<AudioClip>("assets/audio/pipupupusound.mp3");
harmony.PatchAll(typeof(HoarderBugPatch));
mls.LogInfo((object)"HappyVVlnaJle.PipupupuMod is loaded");
}
harmony.PatchAll(typeof(PipupupuModBase));
}
}
}
namespace PipupupuMod.Patches
{
[HarmonyPatch(typeof(HoarderBugAI))]
internal class HoarderBugPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
public static void hoarderBugAudioPatch(ref AudioClip[] ___chitterSFX)
{
AudioClip[] bugSFX = PipupupuModBase.bugSFX;
___chitterSFX = bugSFX;
}
}
}