using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BoneLib;
using BoneLib.BoneMenu;
using HarmonyLib;
using Il2CppSLZ.Marrow;
using LabFusion.Utilities;
using MelonLoader;
using MelonLoader.Preferences;
using Testing;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Class1), "Insult", "1.0.0", "CooladTheGreat", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: AssemblyTitle("Testing")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Testing")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c2ce90cf-13fd-444e-b8f1-155bdf7eb949")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Testing;
public class Class1 : MelonMod
{
private enum MessageType
{
None,
GoodMessages,
BadMessages
}
[HarmonyPatch(typeof(Player_Health), "Death")]
private static class DeathPatch
{
[HarmonyPostfix]
private static void Postfix()
{
ShowRandomDeathMessage();
}
}
private static MelonPreferences_Category _prefsCategory;
private static MelonPreferences_Entry<int> _messageModePref;
private static MessageType _currentMode;
private static Random random = new Random();
private static List<string> Badmessageslist = new List<string>
{
"Wow you suck.", "HAHAHAHAHAHA", "*insert funny clip of you dying here*", "Hey, is anyone in there?", "PFFFFFFT", "Bro AIM like AIM BRO.", "This one is on you.", "If i had a dollar for everytime you died I would be SWIMMING IN CASH.", "Death by either a kid or yourself.", "L in the chat",
"Type 1 if this guy sucks.", "You're byond dead.", "Why should I respawn you, its just gonna happen again. But it's my job.", "What is wrong with you huh? Can't stop dying?", "Now thats just sad. Very sad.", "That wasn't supposed to happen", "Failure!", "Too weak.", "Bones: broken", "Life: ended.",
"How did you even get here if you can't survive THAT.", "Welcome to the void. Oh wait I can't tell you there is a time period where you ge-", "I have no words for the disappointment I have right now.", "...", "Yep that was gonna happen.", "Do you even know how to play?"
};
private static List<string> Goodmessageslist = new List<string>
{
"Get back up!.", "You got this!", "*insert funny clip of him dying here*", "That guy is def cheating.", "Don't give up now.", "Feel the rage KILL HIM.", "This one is not on you.", "If i had a dollar for everytime you died I would be broke.", "Death should never stop you.", "F in the chat",
"Type 1 if this guy is good.", "You're gonna make it.", "Respawning you to kick his butt!.", "Destroy him.", "He is a disapointment dont let him drag you down!", "That wasn't supposed to happen", "Hes a failure!", "He is too weak.", "Break his bones.", "End his virtual life.",
"You have survived worse.", "Welcome back. Ready to kill him?", "Just kill him.", "Demolish that guy. You got this.", "Your gonna let that slide? I wouldn't.", "He drank your apple juice."
};
public static Page MainPage { get; private set; }
public override void OnInitializeMelon()
{
InitializePreferences();
SetupBoneMenu();
Hooking.OnLevelLoaded += OnLevelLoaded;
MelonLogger.Msg("Death Messages mod initialized!");
}
public override void OnDeinitializeMelon()
{
Hooking.OnLevelLoaded -= OnLevelLoaded;
}
private static void InitializePreferences()
{
_prefsCategory = MelonPreferences.CreateCategory("DeathMessages");
_messageModePref = _prefsCategory.CreateEntry<int>("MessageMode", 0, "Message Mode", "0=None, 1=GoodMessages, 2=BadMessages", false, false, (ValueValidator)null, (string)null);
_currentMode = (MessageType)_messageModePref.Value;
}
private static void SavePreferences()
{
_messageModePref.Value = (int)_currentMode;
MelonPreferences.Save();
MelonLogger.Msg($"Saved message mode: {_currentMode}");
}
private static void SetupBoneMenu()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
MainPage = Page.Root.CreatePage("Death Messages", Color.cyan, 0, true);
MainPage.CreateEnum("Mode: ", Color.white, (Enum)_currentMode, (Action<Enum>)OnModeChanged);
}
private static void OnModeChanged(Enum value)
{
_currentMode = (MessageType)(object)value;
SavePreferences();
Message();
}
private static void Message()
{
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Expected O, but got Unknown
string text = _currentMode switch
{
MessageType.None => "Death messages disabled",
MessageType.GoodMessages => "Encouragement mode enabled!",
MessageType.BadMessages => "Insult mode enabled!",
_ => "Unknown mode",
};
FusionNotifier.Send(new FusionNotification
{
Title = NotificationText.op_Implicit("Death Messages"),
Message = NotificationText.op_Implicit(text),
ShowPopup = true,
Type = (NotificationType)0,
PopupLength = 2f
});
}
private static void ShowRandomDeathMessage()
{
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: 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)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Expected O, but got Unknown
if (_currentMode != 0)
{
string text;
string text2;
if (_currentMode == MessageType.BadMessages)
{
text = Badmessageslist[random.Next(Badmessageslist.Count)];
text2 = "Insult";
}
else
{
text = Goodmessageslist[random.Next(Goodmessageslist.Count)];
text2 = "Encouragement";
}
FusionNotifier.Send(new FusionNotification
{
Title = NotificationText.op_Implicit(text2),
Message = NotificationText.op_Implicit(text),
ShowPopup = true,
Type = (NotificationType)0,
PopupLength = 4f
});
}
}
private void OnLevelLoaded(LevelInfo levelInfo)
{
Message();
}
}