Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of DiplingsAdditions v1.0.4
DiplingsAdditions.dll
Decompiled a year agousing System.Collections; 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 DiplingsAdditions; 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("DiplingsAdditions")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DiplingsAdditions")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("72082814-6983-4ec2-991d-5133449b360d")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] internal class Music { internal static bool playing; internal static IEnumerator PlayLevelMusicWithIntro(AudioClip intro, AudioClip music) { DiplingsAdditionsBase.mls.LogInfo((object)"About to play music with intro..."); playing = true; yield return (object)new WaitForSeconds(0.2f); HUDManager.Instance.UIAudio.PlayOneShot(intro); yield return (object)new WaitForSeconds(intro.length); while (MusicPatches.inside) { HUDManager.Instance.UIAudio.PlayOneShot(music); yield return (object)new WaitForSeconds(music.length); } playing = false; } } [HarmonyPatch] internal class MusicPatches { internal static bool inside = false; internal static AudioClip intro = null; internal static AudioClip music = null; internal static List<AudioClip> Musics = DiplingsAdditionsBase.SoundFX; [HarmonyPatch(typeof(EntranceTeleport), "TeleportPlayer")] [HarmonyPrefix] private static void EntranceTeleportPreTeleportPlayer(EntranceTeleport __instance) { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) if (!inside) { DiplingsAdditionsBase.mls.LogInfo((object)"About to enter dungeon..."); inside = true; if (!Music.playing) { switch (RoundManager.Instance.currentDungeonType) { case 0: DiplingsAdditionsBase.mls.LogInfo((object)"Dungeon type is Factory."); break; case 1: DiplingsAdditionsBase.mls.LogInfo((object)"Dungeon type is Manor."); intro = Musics[0]; music = Musics[1]; break; case 2: DiplingsAdditionsBase.mls.LogInfo((object)"Dungeon type is Mineshaft."); break; default: DiplingsAdditionsBase.mls.LogError((object)"Unknown dungeon type. No music can play."); break; } if ((Object)(object)music != (Object)null && (Object)(object)intro != (Object)null) { ((MonoBehaviour)__instance).StartCoroutine(Music.PlayLevelMusicWithIntro(intro, music)); } } } else { DiplingsAdditionsBase.mls.LogInfo((object)"About to exit dungeon..."); inside = false; intro = null; music = null; } } [HarmonyPatch(typeof(StartOfRound), "SetShipReadyToLand")] [HarmonyPostfix] private static void StartOfRoundPostSetShipReadyToLand() { DiplingsAdditionsBase.mls.LogInfo((object)"Reset inside bool."); inside = false; } [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPostfix] private static void StartOfRoundPostAwake() { DiplingsAdditionsBase.mls.LogInfo((object)"Reset inside bool."); inside = false; } } namespace DiplingsAdditions; [BepInPlugin("DiplingsAdditions", "Dipling's Additions", "1.0.4")] public class DiplingsAdditionsBase : BaseUnityPlugin { private const string modGUID = "DiplingsAdditions"; private const string modName = "Dipling's Additions"; private const string modVersion = "1.0.4"; private readonly Harmony harmony = new Harmony("DiplingsAdditions"); private static DiplingsAdditionsBase 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("DiplingsAdditions"); mls.LogInfo((object)"The logger has been created!"); mls.LogInfo((object)"The mod is about to patch..."); harmony.PatchAll(); mls.LogInfo((object)"The mod has patched successfully!"); mls.LogInfo((object)"The asset bundle is about to load..."); SoundFX = new List<AudioClip>(); string location = ((BaseUnityPlugin)Instance).Info.Location; location = location.TrimEnd("DiplingsAdditions.dll".ToCharArray()); Bundle = AssetBundle.LoadFromFile(location + "levelmusics"); if ((Object)(object)Bundle != (Object)null) { SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList(); mls.LogInfo((object)"Asset bundle loaded successfully!"); } else { mls.LogError((object)"Failed to load asset bundle."); } } }