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 System.Text.RegularExpressions;
using BepInEx;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("SarcasticPotion")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SarcasticPotion")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("cfb9ec2c-f5b7-4bf7-b088-231a8189f02b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("bonta.sarcasm", "LovePotionMoreLines", "1.0.1")]
public class LovePotionMoreLines : BaseUnityPlugin
{
[HarmonyPatch]
private class LovePotionMessagePatch
{
private static MethodBase TargetMethod()
{
return AccessTools.Method(AccessTools.TypeByName("ValuableLovePotion"), "GenerateAffectionateSentence", (Type[])null, (Type[])null);
}
[HarmonyPrefix]
private static bool Prefix(object __instance, ref string __result)
{
if (Random.value < 0.5f)
{
string input = "";
FieldInfo fieldInfo = AccessTools.Field(__instance.GetType(), "playerName");
if (fieldInfo != null)
{
input = (fieldInfo.GetValue(__instance) as string) ?? "";
}
string text = Regex.Replace(input, "[^a-zA-Z0-9 ]", "");
bool num = text.Trim().Equals("this potion", StringComparison.OrdinalIgnoreCase);
List<string> list = new List<string>
{
"I adore everything about you, [player]. Especially your absence.", "I've seen rocks with more personality than you, [player].", "This potion tastes as bitter as my feelings for you, [player].", "[player], you're not the worst I've seen... but that's not saying much.", "I'd rather solo this haunted mess than spend another minute with [player].", "Teaming up with [player] is like babysitting a malfunctioning toaster.", "[player], remind me again: who let you out of the tutorial?", "The real horror here isn't the monster; it's cooperating with [player].", "My job would be easier if [player] stayed back in the lobby.", "Hey [player], ever thought about retiring from this game? Immediately?",
"Can we trade [player] for one of the monsters? At least they're predictable.", "Oh look, [player]'s here, time to lower expectations.", "[player], have you tried not being terrible?", "I'd call [player] a teammate, but I prefer 'obstacle.'", "Working with [player], the scariest part of this horror game.", "[player], your performance is inspiring, in all the wrong ways.", "I'm impressed by your consistency, [player]. You're reliably useless.", "[player], great job, said no one ever.", "If incompetence was currency, [player] would be rich.", "[player], remind me why we brought you again?",
"[player], do the ghosts pay you to sabotage us?", "I’d rather face the boss solo than rely on [player].", "[player]'s gameplay proves evolution goes backward sometimes.", "Honestly, I think [player] is a ghost's best weapon.", "[player], is there a potion for skill? Because you desperately need one.", "Working with [player] makes me envy the ghosts, they can vanish.", "[player], I'd offer advice, but I doubt you'd understand.", "I’ve seen cursed items more useful than [player].", "[player], did you drop your brain at the lobby or is this normal?", "Even a haunted chair contributes more than [player].",
"[player] is the reason tutorials have warnings.", "Someone tell [player] the idea is to avoid dying, not perfect it.", "[player], are you intentionally trying to fail, or is it just instinct?", "[player] makes me miss the NPCs.", "Having [player] here is punishment enough.", "[player], you redefine the concept of a liability.", "I'd team with a possessed doll over [player]. Less creepy, too.", "[player]’s presence makes me rethink the value of teamwork.", "If [player]'s gaming was a haunted house, even ghosts wouldn't stay.", "[player], your incompetence might actually summon demons.",
"I've met NPCs with more depth than [player]'s strategy.", "[player], you’d be a cautionary tale if anyone cared enough.", "If skill had an enemy, it would look suspiciously like [player].", "Playing with [player], like playing hide and seek with your sanity.", "[player] is proof even a ghost can feel secondhand embarrassment.", "I've fought less annoying bosses than [player].", "[player], watching you play is the real jump scare here.", "[player], is your incompetence haunted or just naturally terrifying?", "[player] isn’t just bad, they've elevated failure to art.", "If [player] was a potion, I'd rather drink poison.",
"[player]'s participation trophy says 'Please Stop Trying.'", "Next time, [player], volunteer to be the sacrifice.", "[player], your only purpose is to distract the monsters.", "The ghosts asked us to leave [player] behind, they find incompetence unbearable.", "[player], you're proof even monsters have standards.", "[player], you're lucky friendly fire isn't enabled.", "If stupidity were lethal, [player] wouldn't survive the loading screen.", "[player], do humanity a favor and uninstall.", "Even ghosts regret haunting you, [player].", "[player], the monsters complain about having to deal with you.",
"[player], you're why abandonment is sometimes justified."
};
List<string> list2 = new List<string>
{
"Roses are red, violets are blue, I'm under a spell and it makes me rue.", "My love for you is like this potion: hard to swallow.", "Great, now even my potions disappoint me.", "Can a potion refund itself? Asking for myself.", "If incompetence had a potion form, this would be it.", "Just drank disappointment. Tastes exactly how teamwork feels.", "I used to think haunted artifacts were cursed, turns out it's just my luck.", "I'd trade this potion for an angry poltergeist. Better company, honestly.", "Congratulations, you've crafted bottled regret.", "Haunted mansion, abandoned asylum, who picks these places? Fire them immediately.",
"This mission couldn't get worse unless the potion started talking back.", "If I find one more worthless relic, I'm offering myself to the ghosts.", "Whoever built this level clearly had unresolved issues.", "This place makes me wish I'd chosen a safer career, like chainsaw juggling.", "Another room full of junk? I'd pretend to be shocked, but honestly, I'm numb.", "I’m stuck in a haunted building, still better company than most teammates.", "Picked another cursed relic, it's like I enjoy suffering.", "Ghost hunting alone. Because trusting others went so well last time.", "I’m in a love-hate relationship with survival. Mostly hate.", "Another creepy hallway, didn't see that coming, said nobody ever.",
"Potions and ghosts, what could possibly go wrong, except everything?", "Today’s goal: survive despite my best efforts otherwise.", "If mistakes had rewards, I'd be top-ranked.", "At least when I'm alone, I can only blame myself.", "Turns out I'm the scariest thing in this haunted mess.", "Honestly, these monsters should run from my terrible choices.", "I keep making the same mistakes, it's impressive in a tragic way.", "I thought horror meant monsters, not my life decisions.", "Apparently, self-sabotage is my hidden talent.", "My survival instincts must be haunted by incompetence.",
"I’m just here to make ghosts feel better about themselves.", "At this point, the monsters pity me more than fear me.", "Why fear death when my gameplay is scarier?", "My greatest enemy? My own choices, clearly.", "This potion tastes exactly like regret.", "My strategy is so bad, even ghosts laugh.", "Monsters don’t chase me anymore, they're embarrassed for me.", "I'd haunt myself for these decisions.", "My plan A? Panic. Plan B? More panic.", "I’m single-handedly lowering the ghosts' standards.",
"This isn't a mission, it's self-inflicted punishment.", "I’m just giving monsters a reason to retire early.", "The real horror story is my skill level.", "Even cursed objects avoid me, they have standards.", "The monsters won't kill me out of sheer pity.", "Who knew failure was a lifestyle choice?", "My character's real power: self-sabotage.", "At this point, losing feels like an achievement.", "My life choices scare the ghosts.", "Turns out the haunting is me."
};
string text2;
if (num)
{
text2 = list2[Random.Range(0, list2.Count)];
}
else
{
text2 = list[Random.Range(0, list.Count)];
text2 = text2.Replace("[player]", text);
}
__result = text2;
return false;
}
return true;
}
[HarmonyPostfix]
private static void Postfix(object __instance, ref string __result)
{
FieldInfo fieldInfo = AccessTools.Field(__instance.GetType(), "playerName");
if (fieldInfo != null)
{
string text = fieldInfo.GetValue(__instance) as string;
if (!string.IsNullOrEmpty(text))
{
string newValue = Regex.Replace(text, "[^a-zA-Z0-9 ]", "");
__result = __result.Replace(text, newValue);
}
}
}
}
private static Harmony _harmony;
private void Awake()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Expected O, but got Unknown
_harmony = new Harmony("bonta.sarcasm");
_harmony.PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"LovePotionMoreLines loaded – sarcasm activated.");
}
}