Please disclose if any significant portion of your mod was created 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 HalloweenElevator v1.0.1
HalloweenElevator.dll
Decompiled a year agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using LobbyCompatibility.Enums; using LobbyCompatibility.Features; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("HalloweenElevator")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Restores the Halloween aesthetics for the mineshaft elevator")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1+6f83286224fdb89dbfaaad8dd6e078b01bb83866")] [assembly: AssemblyProduct("HalloweenElevator")] [assembly: AssemblyTitle("HalloweenElevator")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace HalloweenElevator { internal static class LobbyCompatibility { internal static void Init() { PluginHelper.RegisterPlugin("butterystancakes.lethalcompany.halloweenelevator", Version.Parse("1.0.1"), (CompatibilityLevel)0, (VersionStrictness)0); } } [BepInPlugin("butterystancakes.lethalcompany.halloweenelevator", "Halloween Elevator", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal const string PLUGIN_GUID = "butterystancakes.lethalcompany.halloweenelevator"; internal const string PLUGIN_NAME = "Halloween Elevator"; internal const string PLUGIN_VERSION = "1.0.1"; internal static ManualLogSource Logger; private const string GUID_LOBBY_COMPATIBILITY = "BMX.LobbyCompatibility"; internal static ConfigEntry<float> configChance; internal static ConfigEntry<bool> configEclipse; internal static ConfigEntry<bool> configFog; private void Awake() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility")) { Logger.LogInfo((object)"CROSS-COMPATIBILITY - Lobby Compatibility detected"); LobbyCompatibility.Init(); } configChance = ((BaseUnityPlugin)this).Config.Bind<float>("Criteria", "Chance", 0f, new ConfigDescription("The percentage chance for the elevator to be spookified any day. (0 = never, 1 = guaranteed, or anything in between - 0.5 = 50% chance)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); configEclipse = ((BaseUnityPlugin)this).Config.Bind<bool>("Criteria", "Eclipses", true, "Spookify the elevator when it's eclipsed."); configFog = ((BaseUnityPlugin)this).Config.Bind<bool>("Criteria", "Indoor Fog", true, "Spookify the elevator when the \"spooky fog\" event is active."); new Harmony("butterystancakes.lethalcompany.halloweenelevator").PatchAll(); Logger.LogInfo((object)"Halloween Elevator v1.0.1 loaded"); } } [HarmonyPatch] internal class ClassicElevatorPatches { private static bool halloween; private static bool done; private static Random musicRandom = new Random(); private static AudioClip elevatorClip; [HarmonyPatch(typeof(RoundManager), "FinishGeneratingNewLevelClientRpc")] [HarmonyPostfix] private static void RoundManager_Post_FinishGeneratingNewLevelClientRpc(RoundManager __instance) { if ((Object)(object)__instance.currentMineshaftElevator == (Object)null || done) { return; } done = true; if ((Object)(object)elevatorClip == (Object)null) { AudioSource elevatorJingleMusic = __instance.currentMineshaftElevator.elevatorJingleMusic; if ((Object)(object)((elevatorJingleMusic != null) ? elevatorJingleMusic.clip : null) != (Object)null) { AudioSource elevatorJingleMusic2 = __instance.currentMineshaftElevator.elevatorJingleMusic; elevatorClip = ((elevatorJingleMusic2 != null) ? elevatorJingleMusic2.clip : null); Plugin.Logger.LogDebug((object)"Cached original elevator music"); } } halloween = Spookify(); Transform obj = ((Component)__instance.currentMineshaftElevator).transform.Find("AnimContainer/NeonLights/Point Light"); Light val = ((obj != null) ? ((Component)obj).GetComponent<Light>() : null); if ((Object)(object)val != (Object)null) { val.colorTemperature = (halloween ? 4131f : 6217f); } if (halloween) { musicRandom = new Random(StartOfRound.Instance.randomMapSeed); } } private static bool Spookify() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 if (Plugin.configEclipse.Value && (int)StartOfRound.Instance.currentLevel.currentWeather == 5) { return true; } if (Plugin.configFog.Value && ((Component)RoundManager.Instance.indoorFog).gameObject.activeSelf) { return true; } float value = Plugin.configChance.Value; float num = (float)new Random(StartOfRound.Instance.randomMapSeed).NextDouble(); Plugin.Logger.LogDebug((object)$"RNG: {num}"); if (value > 0f && (value >= 1f || num < value)) { return true; } DateTime utcNow = DateTime.UtcNow; if (utcNow.Month == 10 && (utcNow.Day > 30 || utcNow.Day == 22 || utcNow.Day == 23)) { return true; } return false; } [HarmonyPatch(typeof(MineshaftElevatorController), "SetElevatorMusicClientRpc")] [HarmonyPostfix] private static void MineshaftElevatorController_Post_SetElevatorMusicClientRpc(MineshaftElevatorController __instance, bool setOn) { if (!setOn) { return; } bool isPlaying = __instance.elevatorJingleMusic.isPlaying; __instance.elevatorJingleMusic.Stop(); if (halloween) { if (__instance.elevatorMovingDown) { __instance.elevatorJingleMusic.clip = __instance.elevatorHalloweenClips[musicRandom.Next(__instance.elevatorHalloweenClips.Length)]; } else { __instance.elevatorJingleMusic.clip = __instance.elevatorHalloweenClipsLoop[musicRandom.Next(__instance.elevatorHalloweenClipsLoop.Length)]; } } else if ((Object)(object)elevatorClip != (Object)null) { __instance.elevatorJingleMusic.clip = elevatorClip; } if (isPlaying) { __instance.elevatorJingleMusic.Play(); } } [HarmonyPatch(typeof(MineshaftElevatorController), "OnDisable")] [HarmonyPostfix] private static void MineshaftElevatorController_Post_OnDisable(MineshaftElevatorController __instance) { done = false; } } public static class PluginInfo { public const string PLUGIN_GUID = "HalloweenElevator"; public const string PLUGIN_NAME = "HalloweenElevator"; public const string PLUGIN_VERSION = "1.0.1"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }