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 CMSound_Mod.Patches;
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("CMSound_Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CMSound_Mod")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9ab0826c-30f5-4487-a6a6-ae2e0f7c3e99")]
[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 CMSound_Mod
{
[BepInPlugin("Poseidon.CMSound_Mod", "CM Sound Mod", "1.0.0.0")]
public class CMSound_Mod_Base : BaseUnityPlugin
{
private const string modGUID = "Poseidon.CMSound_Mod";
private const string modName = "CM Sound Mod";
private const string modVersion = "1.0.0.0";
private readonly Harmony harmony = new Harmony("Poseidon.CMSound_Mod");
internal static CMSound_Mod_Base Instance;
internal static 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("Poseidon.CMSound_Mod");
mls.LogInfo((object)"The Scooby Laugh is Active!!!!!");
harmony.PatchAll(typeof(CMSound_Mod_Base));
harmony.PatchAll(typeof(StartOfRoundPatch));
mls = ((BaseUnityPlugin)this).Logger;
SoundFX = new List<AudioClip>();
string location = ((BaseUnityPlugin)Instance).Info.Location;
location = location.TrimEnd("CMSound_Mod.dll".ToCharArray());
Bundle = AssetBundle.LoadFromFile(location + "scoob");
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 CMSound_Mod.Patches
{
[HarmonyPatch(typeof(StartOfRound))]
internal class StartOfRoundPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void OverrideAudio(StartOfRound __instance)
{
__instance.shipIntroSpeechSFX = CMSound_Mod_Base.SoundFX[0];
}
}
}