Decompiled source of Death Message Plus v1.0.1

plugins/DeathMessagePlus.dll

Decompiled 6 months ago
using 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.Configuration;
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("DeathMessagePlus")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DeathMessagePlus")]
[assembly: AssemblyTitle("DeathMessagePlus")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace DeathMessagePlus;

[BepInPlugin("ACTPlugins.Automagic.DMP", "Death Message Plus", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	[HarmonyPatch(typeof(GUIManager), "Die")]
	private class DiePatch
	{
		[HarmonyPrefix]
		public static bool Prefix()
		{
			string text = deathStrings[Random.Range(0, deathStrings.Length)];
			GUIManager.instance.PlayDarkSoulsText(text, "YouDied");
			return false;
		}
	}

	[HarmonyPatch(typeof(LocalizedText), "GetText", new Type[]
	{
		typeof(string),
		typeof(bool)
	})]
	private class GetTextPatch
	{
		[HarmonyPostfix]
		public static string Postfix(string __result)
		{
			string result = __result;
			if (__result.Contains("LOC: "))
			{
				result = __result.Replace("LOC: ", "");
			}
			return result;
		}
	}

	public ConfigEntry<string> configDeathString;

	public static string[] deathStrings;

	private void Awake()
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Expected O, but got Unknown
		configDeathString = ((BaseUnityPlugin)this).Config.Bind<string>("General", "DeathText", "A Watery Grave|Uh Oh|That looked embarrassing|You are dead. Not big surprise.|Honestly you deserved it|Maybe don't do that next time|You Suck|Try some of the accessibility options|\ud83d\ude02\ud83d\ude02\ud83d\ude02|Erm, What the Scallop?|Krill Issue|Get Rekt|Shark Bait Hoo Ha Ha|Bruh|Oops|You're Fried . . . |gg, go next|Shoulda Teched|Lol  ,  Lmao even.|Hope it wasnt your rank up match|The world is ending and its your fault|According to all known laws of aviation, there is no way a bee should be able to fly. Its wings are too small to get its fat little body off the ground. The bee, of course, flies anyway because bees don't care what humans think is impossible. Yellow, black. Yellow, black. Yellow, black. Yellow, black. Ooh, black and yellow! Let's shake it up a little. Barry! Breakfast is ready! Ooming! Hang on a second. Hello? - Barry? - Adam? - Oan you believe this is happening? - I can't. I'll pick you up. Looking sharp. Use the stairs. Your father paid good money for those. Sorry. I'm excited. Here's the graduate. We're very proud of you, son. A perfect report card, all B's. Very proud. Ma! I got a thing going here. - You got lint on your fuzz. - Ow! That's me! - Wave to us! We'll be in row 118,000. - Bye! Barry, I told you, stop flying in the house! - Hey, Adam. - Hey, Barry. - Is that fuzz gel? - A little. Special day, graduation. Never thought I'd make it. Three days grade school, three days high school. Those were awkward. Three days college. I'm glad I took a day and hitchhiked around the hive. You did come back different. - Hi, Barry. - Artie, growing a mustache? Looks good. - Hear about Frankie? - Yeah. - You going to the funeral? - No, I'm not going. Everybody knows, sting someone, you die. Don't waste it on a squirrel. Such a hothead. I guess he could have just gotten out of the way. I love this incorporating an amusement park into our day. That's why we don't need vacations. Boy, quite a bit of pomp... under the circumstances. - Well, Adam, today we are men. - We are! - Bee-men. - Amen! Hallelujah! Students, faculty, distinguished bees, please welcome Dean Buzzwell. Welcome, New Hive Oity graduating class of... ...9:15. That concludes our ceremonies. And begins your career at Honex Industries! Will we pick ourjob today? I heard it's just orientation. Heads up! Here we go. Keep your hands and antennas inside the tram at all times. - Wonder what it'll be like? - A little scary. Welcome to Honex, a division of Honesco and a part of the Hexagon Group. This is it! Wow. Wow. We know that you, as a bee, have worked your whole life to get to the point where you can work for your whole life. Honey begins when our valiant Pollen Jocks bring the nectar to the hive. Our top-secret formula is automatically color-corrected, scent-adjusted and bubble-contoured into this soothing sweet syrup with its distinctive golden glow you know as... Honey! - That girl was hot. - She's my cousin! - She is? - Yes, we're all cousins. - Right. You're right. - At Honex, we constantly strive to improve every aspect of bee existence. These bees are stress-testing a new helmet technology. - What do you think he makes? - Not enough. Here we have our latest advancement, the Krelman. - What does that do? - Oatches that little strand of honey that hangs after you pour it. Saves us millions. Oan anyone work on the Krelman? Of course. Most bee jobs are small ones. But bees know that every small job, if it's done well, means a lot. But choose carefully because you'll stay in the job you pick for the rest of your life. The same job the rest of your life? I didn't know that. What's the difference? You'll be happy to know that bees, as a ", "Displays a random message upon death. Each option must be seperated with a '|' character");
		deathStrings = configDeathString.Value.Split(new char[1] { '|' });
		Harmony val = new Harmony("com.example.patch");
		val.PatchAll();
	}
}
public static class MyPluginInfo
{
	public const string PLUGIN_GUID = "DeathMessagePlus";

	public const string PLUGIN_NAME = "DeathMessagePlus";

	public const string PLUGIN_VERSION = "1.0.0";
}