using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using PluginConfig.API; using PluginConfig.API.Decorators; using PluginConfig.API.Fields; using PluginConfig.API.Functionals; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("bitmotte.modthatclosesthegamewhenitopens")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyProduct("modthatclosesthegamewhenitopens")] [assembly: AssemblyTitle("bitmotte.modthatclosesthegamewhenitopens")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 modthatclosesthegamewhenitopens { public static class BundleTool { public static AssetBundle Load(string fileName) { return AssetBundle.LoadFromMemory(EmbeddedAccess.AccessFile(fileName)); } } public static class Configurator { [CompilerGenerated] private static class <>O { public static OnClick <0>__OpenDiscord; } public static FloatField chance; public static BoolField music; public static ButtonField joinDC; public static PluginConfigurator CreateConfigurator() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown PluginConfigurator val = PluginConfigurator.Create("modthatclosesthegamewhenitopens", "bitmotte.modthatclosesthegamewhenitopens"); chance = new FloatField(val.rootPanel, "Chance ( % )", "chance", 0.1f); music = new BoolField(val.rootPanel, "Change Music", "music", true); ConfigSpace val2 = new ConfigSpace(val.rootPanel, 15f); ConfigHeader val3 = new ConfigHeader(val.rootPanel, "Join my discord for sneak peeks,devlogs,and the possibility to test my mods early ! !", 20, (TextAlignmentOptions)513); joinDC = new ButtonField(val.rootPanel, "Join my Discord", "joinDC"); ConfigSpace val4 = new ConfigSpace(val.rootPanel, 15f); ButtonField obj = joinDC; object obj2 = <>O.<0>__OpenDiscord; if (obj2 == null) { OnClick val5 = OpenDiscord; <>O.<0>__OpenDiscord = val5; obj2 = (object)val5; } obj.onClick += (OnClick)obj2; return val; } private static void OpenDiscord() { Process.Start("https://discord.gg/PjSpcEvuB7"); } } public static class EmbeddedAccess { public static byte[] AccessFile(string fileName) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); byte[] array; using (Stream stream = executingAssembly.GetManifestResourceStream("modthatclosesthegamewhenitopens.resources." + fileName)) { if (stream == null) { return null; } array = new byte[stream.Length]; stream.Read(array, 0, array.Length); } return array; } } public class IDontWantToDIe : MonoBehaviour { public void OnDestroy() { MonoSingleton.Instance.PowerCount--; } } public class modthatclosesthegamewhenitopensPowerManager : MonoSingleton { private MusicManager mm; private AudioSource musicSource; private int powerCount; public int prevPowerCount; private bool sharted; public int PowerCount { get { return powerCount; } set { prevPowerCount = powerCount; powerCount = value; Check(); } } public void Awake() { ((MonoBehaviour)this).Invoke("DoubleCheck", 3f); } public void Start() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (!sharted) { sharted = true; mm = MonoSingleton.Instance; musicSource = ((Component)this).gameObject.AddComponent(); musicSource.clip = Addressables.LoadAssetAsync((object)"Assets/Music/8-3.wav").WaitForCompletion(); musicSource.outputAudioMixerGroup = Addressables.LoadAssetAsync((object)"MusicAudio").WaitForCompletion(); AudioSourceExtensions.SetSpatialBlend(musicSource, 0f); musicSource.loop = true; musicSource.Stop(); } } private void Check() { Start(); if (!((Object)(object)mm == (Object)null)) { if (powerCount == 1 && prevPowerCount == 0 && Configurator.music.value) { musicSource.Play(); mm.volume = 0f; } if (powerCount == 0) { musicSource.Stop(); mm.volume = mm.defaultVolume; } } } public void Decrement() { PowerCount--; } public void DoubleCheck() { Power[] array = Object.FindObjectsByType((FindObjectsSortMode)0); if (array.Length == 0) { powerCount = 0; prevPowerCount = 0; Check(); } Plugin.Logger.LogInfo((object)powerCount); ((MonoBehaviour)this).Invoke("DoubleCheck", 0.5f); } } [HarmonyPatch(typeof(EnemyIdentifier), "Start")] public static class patcg { private static void Prefix(EnemyIdentifier __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Invalid comparison between Unknown and I4 //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown if ((int)__instance.enemyType == 40 || (int)__instance.enemyType == 21 || (int)__instance.enemyType == 39) { return; } float num = Random.Range(0f, 100f); if (num < Configurator.chance.value) { GameObject val = Object.Instantiate(AssetHelper.LoadPrefab("Assets/Prefabs/Enemies/PowerWithSpawnEffect.prefab")); val.transform.parent = ((Component)__instance).transform.parent; if ((int)__instance.enemyType == 4) { val.transform.parent = ((Component)__instance).transform.parent.parent; } val.transform.position = ((Component)__instance).transform.position; val.transform.rotation = ((Component)__instance).transform.rotation; if ((Object)(object)MonoSingleton.Instance == (Object)null) { GameObject val2 = new GameObject("modthatclosesthegamewhenitopens Power Manager"); val2.AddComponent(); } MonoSingleton.Instance.PowerCount++; UnityEvent val3 = new UnityEvent(); val3.AddListener(new UnityAction(MonoSingleton.Instance.Decrement)); val.GetComponentInChildren().onDeath = val3; val.AddComponent(); if (MonoSingleton.Instance.PowerCount == 1 && MonoSingleton.Instance.prevPowerCount == 0) { PowerIntro component = val.GetComponent(); component.introOverride = Addressables.LoadAssetAsync((object)"Assets/Sounds/Voices/Power/pow_SpecialIntro1.ogg").WaitForCompletion(); component.animationSpeedMultiplier = 1f; SubtitledAudioSource val4 = val.AddComponent(); SubtitleDataLine val5 = new SubtitleDataLine(); val5.subtitle = "modthatclosesthegamewhenitopens!"; val5.time = 0f; SubtitleDataLine val6 = new SubtitleDataLine(); val6.subtitle = "Where is Gabriel and what have you done to him?"; val6.time = 1f; SubtitleData val7 = new SubtitleData(); val7.lines = (SubtitleDataLine[])(object)new SubtitleDataLine[2] { val5, val6 }; val4.subtitles = val7; val4.audioSource = val.GetComponent(); } Object.Destroy((Object)(object)((Component)__instance).gameObject); } } } [BepInPlugin("bitmotte.modthatclosesthegamewhenitopens", "modthatclosesthegamewhenitopens", "1.1.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; public static PluginConfigurator config; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"die !!!!!!!!!!!!!!!!!!!!!!!¡"); Application.Quit(); Logger.LogInfo((object)"die !!!!!!!!!!!!!!!!!!!!!!!¡"); Application.Quit(); Logger.LogInfo((object)"die !!!!!!!!!!!!!!!!!!!!!!!¡"); Application.Quit(); Logger.LogInfo((object)"die !!!!!!!!!!!!!!!!!!!!!!!¡"); Application.Quit(); Logger.LogInfo((object)"die !!!!!!!!!!!!!!!!!!!!!!!¡"); Application.Quit(); Logger.LogInfo((object)"what"); Application.Quit(); Logger.LogInfo((object)"pleas die"); Application.Quit(); Logger.LogInfo((object)"fuck you mate"); Application.Quit(); Logger.LogInfo((object)"ehnrhegqweggqw"); } private void OnSceneLoad(Scene scene, LoadSceneMode mode) { Application.Quit(); Logger.LogInfo((object)"what"); Application.Quit(); Logger.LogInfo((object)"what"); Application.Quit(); Logger.LogInfo((object)"what"); Application.Quit(); Logger.LogInfo((object)"what"); Application.Quit(); Logger.LogInfo((object)"what"); Application.Quit(); Logger.LogInfo((object)"what"); Application.Quit(); Logger.LogInfo((object)"what"); Application.Quit(); Logger.LogInfo((object)"what"); } } public static class SetupResource { public static GameObject FixShader(GameObject gameObject) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) Shader shader = Addressables.LoadAssetAsync((object)"Assets/Materials/Environment/Metal/Pattern 1/Metal Pattern 1 8.mat").WaitForCompletion().shader; SkinnedMeshRenderer[] componentsInChildren = gameObject.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val in componentsInChildren) { Material[] materials = ((Renderer)val).materials; foreach (Material val2 in materials) { if (((Object)val2.shader).name == "ULTRAKILL/Master") { val2.shader = shader; } if (((Object)val2.shader).name == "Hidden/InternalErrorShader") { val2.shader = Addressables.LoadAssetAsync((object)"Assets/Materials/Dev/FadeToWhite.mat").WaitForCompletion().shader; } } } MeshRenderer[] componentsInChildren2 = gameObject.GetComponentsInChildren(); foreach (MeshRenderer val3 in componentsInChildren2) { Material[] materials2 = ((Renderer)val3).materials; foreach (Material val4 in materials2) { val4.shader = shader; } } return gameObject; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "bitmotte.modthatclosesthegamewhenitopens"; public const string PLUGIN_NAME = "modthatclosesthegamewhenitopens"; public const string PLUGIN_VERSION = "1.1.0"; } }