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 HazbinHotelMod.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("HazbinHotelMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HazbinHotelMod")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("433bc24f-c779-431d-b0eb-7826a578a2c6")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HazbinHotelMod
{
[BepInPlugin("Tomato.HazbinHotelMod", "Hazbin Hotel Intro Mod", "1.0.0")]
public class HazbinHotelMod : BaseUnityPlugin
{
private const string modGUID = "Tomato.HazbinHotelMod";
private const string modName = "Hazbin Hotel Intro Mod";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("Tomato.HazbinHotelMod");
private static HazbinHotelMod 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("Tomato.HazbinHotelMod");
mls.LogInfo((object)"HazbinHotelMod Intro mod loaded");
SoundFx = new List<AudioClip>();
harmony.PatchAll(typeof(HazbinHotelMod));
string location = ((BaseUnityPlugin)Instance).Info.Location;
location = location.TrimEnd("HazbinHotelMod.dll".ToCharArray());
Bundle = AssetBundle.LoadFromFile(location + "hazbin");
if ((Object)(object)Bundle != (Object)null)
{
mls.LogInfo((object)"HazbinHotel intro Asset Bundle loaded!");
SoundFx = Bundle.LoadAllAssets<AudioClip>().ToList();
}
else
{
mls.LogInfo((object)"HazbinHotel intro Asset Bundle failed to load!");
}
harmony.PatchAll(typeof(ShipIntroPatches));
}
}
}
namespace HazbinHotelMod.Patches
{
[HarmonyPatch(typeof(StartOfRound))]
internal class ShipIntroPatches
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void StartPrefix(StartOfRound __instance)
{
__instance.shipIntroSpeechSFX = HazbinHotelMod.SoundFx[0];
}
}
}