Decompiled source of LowTierMinos v1.1.0

plugins/LowTierMinos/LowTierMinos.dll

Decompiled 11 months ago
using System.Collections.Generic;
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 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: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("LowTierMinos")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("End thyself, Machine")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LowTierMinos")]
[assembly: AssemblyTitle("LowTierMinos")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace LowTierMinos;

[BepInPlugin("ImNotSimon.LowTierMinos", "LowTierMinos", "1.1.0")]
public class Plugin : BaseUnityPlugin
{
	[HarmonyPatch(typeof(StockMapInfo), "Awake")]
	internal class Patch00
	{
		private static void Postfix(StockMapInfo __instance)
		{
			AudioSource[] array = Resources.FindObjectsOfTypeAll<AudioSource>();
			foreach (AudioSource val in array)
			{
				if (Object.op_Implicit((Object)(object)val.clip))
				{
					bool flag = false;
					List<SubtitleDataLine> list = new List<SubtitleDataLine>();
					if (val.clip.GetName() == "mp_intro2")
					{
						Debug.Log((object)"Replacing minos intro");
						val.clip = LowTierMinosBundle.LoadAsset<AudioClip>("lowtierminos.ogg");
						flag = true;
						list.Add(MakeLine("You are a worthless", 0f));
						list.Add(MakeLine("BITCH ASS machine,", 1.2f));
						list.Add(MakeLine("Your life LITERALLY is as valuable as a", 3.5f));
						list.Add(MakeLine("summer ant.", 6f));
						list.Add(MakeLine("I'm just gonna stomp you,", 7.6f));
						list.Add(MakeLine("and you're gonna keep coming back.", 9.25f));
						list.Add(MakeLine("I'mma seal up all my cracks,", 11.1f));
						list.Add(MakeLine("you're gonna keep coming back.", 13.3f));
						list.Add(MakeLine("Why?", 15.5f));
						list.Add(MakeLine("'Cause you smellin' the blood,", 16.1f));
						list.Add(MakeLine("you worthless", 17.6f));
						list.Add(MakeLine("BITCH ASS machine.", 18.6f));
						list.Add(MakeLine("You're gonna stay on my dick until you DIE.", 20.6f));
						list.Add(MakeLine("You serve no purpose in life, your purpose in life is to be on my stream sucking on my dick daily.", 23.1f));
						list.Add(MakeLine("Your purpose in life is to be in that chat BLOWING a dick daily,", 29.3f));
						list.Add(MakeLine("your life is nothing, you serve ZERO purpose!", 32.7f));
						list.Add(MakeLine("YOU SHOULD KILL YOURSELF", 35.9f));
						list.Add(MakeLine("NOW!", 44f));
					}
					if (flag)
					{
						SubtitledAudioSource component = ((Component)val).GetComponent<SubtitledAudioSource>();
						Traverse val2 = Traverse.Create((object)component).Field("subtitles");
						object value = val2.GetValue();
						((SubtitleData)((value is SubtitleData) ? value : null)).lines = list.ToArray();
					}
				}
			}
		}
	}

	private static Harmony harmony;

	internal static AssetBundle LowTierMinosBundle;

	private void Awake()
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Expected O, but got Unknown
		Debug.Log((object)"end thyself (low tier minos starting)");
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		string path = "lowtierminos";
		LowTierMinosBundle = AssetBundle.LoadFromFile(Path.Combine(ModPath(), path));
		harmony = new Harmony("ltg.Minos");
		harmony.PatchAll();
	}

	public static string ModPath()
	{
		return Assembly.GetExecutingAssembly().Location.Substring(0, Assembly.GetExecutingAssembly().Location.LastIndexOf(Path.DirectorySeparatorChar));
	}

	private static SubtitleDataLine MakeLine(string subtitle, float time)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		SubtitleDataLine val = new SubtitleDataLine();
		val.subtitle = subtitle;
		val.time = time;
		return val;
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "LowTierMinos";

	public const string PLUGIN_NAME = "LowTierMinos";

	public const string PLUGIN_VERSION = "1.0.0";
}