Decompiled source of BitchlessMachine v1.0.0

Yourebitchlessmachine.dll

Decompiled 2 months ago
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 Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;
using Yourebitchlessmachine.Utils;

[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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("Yourebitchlessmachine")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Yourebitchlessmachine")]
[assembly: AssemblyTitle("Yourebitchlessmachine")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 Yourebitchlessmachine
{
	[BepInPlugin("doomahreal.ultrakill.bitchless", "Yourebitchlessmachine", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger { get; private set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"DAVID OSHERY NOTICE ME PLEASE");
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)4;
			IMLOADINGITSOHARDDDD.Initialize();
			SceneManager.sceneLoaded += OnSceneLoaded;
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Expected O, but got Unknown
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Expected O, but got Unknown
			if (!(SceneHelper.CurrentScene != "Level 8-3"))
			{
				GameObject val = FindObjectEvenIfDisabled("Pre-Space", "Rooms/7 - Heart Chamber/7 Stuff/Wave 1/PowerWithSpawnEffect");
				if (!((Object)(object)val == (Object)null))
				{
					PowerIntro component = val.GetComponent<PowerIntro>();
					SubtitledAudioSource componentInChildren = val.GetComponentInChildren<SubtitledAudioSource>();
					AssetBundle thegrundle = IMLOADINGITSOHARDDDD.thegrundle;
					AudioClip introOverride = thegrundle.LoadAsset<AudioClip>("Assets/Custom/powermod/bitches.mp3");
					component.introOverride = introOverride;
					SubtitledAudioSource component2 = ((Component)componentInChildren).GetComponent<SubtitledAudioSource>();
					component2.subtitles.lines = (SubtitleDataLine[])(object)new SubtitleDataLine[4]
					{
						new SubtitleDataLine
						{
							time = 0f,
							subtitle = "Halt!"
						},
						new SubtitleDataLine
						{
							time = 0.65f,
							subtitle = "Where are your bitches!?"
						},
						new SubtitleDataLine
						{
							time = 2.9f,
							subtitle = "You,"
						},
						new SubtitleDataLine
						{
							time = 3.4f,
							subtitle = "BITCHLESS machine!"
						}
					};
				}
			}
		}

		public static GameObject FindObjectEvenIfDisabled(string rootName, string objPath = null, int childNum = 0, bool useChildNum = false)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			Scene activeScene = SceneManager.GetActiveScene();
			GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
			foreach (GameObject val in rootGameObjects)
			{
				if (((Object)val).name != rootName)
				{
					continue;
				}
				GameObject val2 = val;
				if (!string.IsNullOrEmpty(objPath))
				{
					Transform val3 = val2.transform.Find(objPath);
					if ((Object)(object)val3 == (Object)null)
					{
						return null;
					}
					val2 = ((Component)val3).gameObject;
				}
				if (useChildNum)
				{
					if (childNum < 0 || childNum >= val2.transform.childCount)
					{
						return null;
					}
					val2 = ((Component)val2.transform.GetChild(childNum)).gameObject;
				}
				return val2;
			}
			return null;
		}
	}
	internal static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "doomahreal.ultrakill.bitchless";

		public const string PLUGIN_NAME = "Yourebitchlessmachine";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace Yourebitchlessmachine.Utils
{
	public static class IMLOADINGITSOHARDDDD
	{
		private const string skibidifile = "Yourebitchlessmachine.power.bundle";

		public static AssetBundle? thegrundle;

		public static void Initialize()
		{
			if ((Object)(object)thegrundle != (Object)null)
			{
				return;
			}
			Assembly assembly = typeof(IMLOADINGITSOHARDDDD).Assembly;
			using Stream stream = assembly.GetManifestResourceStream("Yourebitchlessmachine.power.bundle");
			if (stream == null)
			{
				Debug.LogError((object)"dude you LOADED THE WRONG FUCKING THING YOU STUPID IDIOT");
				return;
			}
			using MemoryStream memoryStream = new MemoryStream();
			stream.CopyTo(memoryStream);
			thegrundle = AssetBundle.LoadFromMemory(memoryStream.ToArray());
			if ((Object)(object)thegrundle == (Object)null)
			{
				Debug.LogError((object)"nice one tons of hussle fun, next time try loading it correctly");
			}
			else
			{
				Debug.Log((object)"yayyyyyy grungle woaded");
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}