using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using Bifrost.TramupgradeData; using EasyDiscoBall; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using MimicAPI.GameAPI; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(EasyDiscoBallMod), "EasyDiscoBall", "1.0.0", "Shlygly", null)] [assembly: MelonGame("ReLUGames", "MIMESIS")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Shlygly")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("EasyDiscoBall")] [assembly: AssemblyTitle("EasyDiscoBall")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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 EasyDiscoBall { public class EasyDiscoBallMod : MelonMod { public override void OnInitializeMelon() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) Preferences.Init(); ((MelonBase)this).LoggerInstance.Msg($"Press {Preferences.ActionKey.Value} to get the Disco Ball upgrade ! ♫"); } public override void OnUpdate() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown if (Keyboard.current == null || !((ButtonControl)Keyboard.current[Preferences.ActionKey.Value]).wasPressedThisFrame) { return; } object currentRoom = RoomAPI.GetCurrentRoom(); if (currentRoom == null) { ((MelonBase)this).LoggerInstance.Warning("Can't install the Disco Ball upgrade : No room loaded !"); return; } VPlayer val = (VPlayer)ActorAPI.GetAllVPlayersInRoom(currentRoom).FirstOrDefault(); if (val == null) { ((MelonBase)this).LoggerInstance.Warning("Can't install the Disco Ball upgrade : No player found !"); return; } IVroom vRoom = ((VActor)val).VRoom; MaintenanceRoom val2 = (MaintenanceRoom)(object)((vRoom is MaintenanceRoom) ? vRoom : null); if (val2 == null) { ((MelonBase)this).LoggerInstance.Warning("Can't install the Disco Ball upgrade : You are not in the maintenance room !"); return; } DataManager dataManager = ManagerAPI.GetDataManager(); if ((Object)(object)dataManager == (Object)null) { ((MelonBase)this).LoggerInstance.Warning("Can't install the Disco Ball upgrade : Unable to access to the data manager !"); return; } TramupgradeData_MasterData[] array = ((IEnumerable)dataManager.ExcelDataManager.GetTramUpgradeMasterIDs()).Select((Func)dataManager.ExcelDataManager.GetTramupgradeData).ToArray(); TramupgradeData_MasterData val3 = ((IEnumerable)array).FirstOrDefault((Func)((TramupgradeData_MasterData upgrade) => upgrade.upgrade_tram_parts_name == "upgrade_parts_discoball")); if (val3 == null) { ((MelonBase)this).LoggerInstance.Warning("Unable to find tram part with name \"upgrade_parts_discoball\" : Gonna use the last known ID for the upgrade..."); val3 = array[5]; } val2.PickUpgradeCandidate(val3.id, true); val2.ApplyTramUpgrage(); val2.SendChangeTramPartsSig(); ((MelonBase)this).LoggerInstance.Msg("Disco Ball upgrade installed !"); } } public static class Preferences { public static MelonPreferences_Entry ActionKey { get; private set; } public static void Init() { MelonPreferences_Category val = MelonPreferences.CreateCategory("EasyDiscoBall"); ActionKey = val.CreateEntry("ActionKey", (Key)97, "Upgrade key", "Press this key to instantly get the DiscoBall upgrade.", false, false, (ValueValidator)null, (string)null); } } }