Decompiled source of FriendCommentCustomizer v1.1.3

CommentCustomizer.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Newtonsoft.Json;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("CommentCustomizer")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CommentCustomizer")]
[assembly: AssemblyTitle("CommentCustomizer")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace CommentCustomizer;

public class CommentConfig
{
	public string[] player_dead { get; set; }

	public string[] good_catch { get; set; }

	public string[] player_fall_small { get; set; }

	public string[] player_fall_big { get; set; }

	public string[] player_hold_mic { get; set; }

	public string[] player_ragdoll { get; set; }

	public string[] player_shroom { get; set; }

	public string[] player_took_damage { get; set; }

	public string[] bomb_held { get; set; }

	public string[] bomb_seen { get; set; }

	public string[] interview { get; set; }

	public string[] multi_monster { get; set; }

	public string[] barnacle_ball { get; set; }

	public string[] big_slap_aggro { get; set; }

	public string[] big_slap_peaceful { get; set; }

	public string[] bombs { get; set; }

	public string[] ear { get; set; }

	public string[] flicker { get; set; }

	public string[] jello { get; set; }

	public string[] knifo { get; set; }

	public string[] larva { get; set; }

	public string[] mouth { get; set; }

	public string[] slurper { get; set; }

	public string[] snatcho { get; set; }

	public string[] spider { get; set; }

	public string[] toolkit_whisk { get; set; }

	public string[] weeping { get; set; }

	public string[] weeping_captured { get; set; }

	public string[] weeping_failed { get; set; }

	public string[] weeping_success { get; set; }

	public string[] zombie { get; set; }

	public string[] black_hole_bot { get; set; }

	public string[] cam_creep { get; set; }

	public string[] dog { get; set; }

	public string[] eye_guy { get; set; }

	public string[] fire_monster { get; set; }

	public string[] harpooner { get; set; }

	public string[] mime { get; set; }

	public string[] puffo { get; set; }

	public string[] robot_button { get; set; }

	public string[] snail_spawner { get; set; }

	public string[] streamer { get; set; }

	public string[] wallo { get; set; }

	public string[] worm { get; set; }

	public Dictionary<string, string[]> hats { get; set; }
}
public static class CustomComments
{
	public static List<string> PlayerDead;

	public static List<string> GoodCatch;

	public static List<string> PlayerFallingSmall;

	public static List<string> PlayerFallingBig;

	public static List<string> PlayerHoldingMic;

	public static List<string> PlayerRagdoll;

	public static List<string> PlayerShroom;

	public static List<string> PlayerTookDamage;

	public static List<string> BombHeld;

	public static List<string> BombSeen;

	public static List<string> Interview;

	public static List<string> MultiMonster;

	public static List<string> BarnacleBall;

	public static List<string> BigSlapAggro;

	public static List<string> BigSlapPeaceful;

	public static List<string> Bombs;

	public static List<string> Ear;

	public static List<string> Flicker;

	public static List<string> Jello;

	public static List<string> Knifo;

	public static List<string> Larva;

	public static List<string> Mouth;

	public static List<string> Slurper;

	public static List<string> Snatcho;

	public static List<string> Spider;

	public static List<string> ToolkitWhisk;

	public static List<string> Weeping;

	public static List<string> WeepingCaptured;

	public static List<string> WeepingFailed;

	public static List<string> WeepingSuccess;

	public static List<string> Zombie;

	public static List<string> BlackHoleBot;

	public static List<string> CamCreep;

	public static List<string> Dog;

	public static List<string> EyeGuy;

	public static List<string> FireMonster;

	public static List<string> Harpooner;

	public static List<string> Mime;

	public static List<string> Puffo;

	public static List<string> RobotButton;

	public static List<string> SnailSpawner;

	public static List<string> Streamer;

	public static List<string> Wallo;

	public static List<string> Worm;

	public static Dictionary<string, List<string>> PlayerHat;

	static CustomComments()
	{
		//IL_040e: Unknown result type (might be due to invalid IL or missing references)
		//IL_047c: Unknown result type (might be due to invalid IL or missing references)
		PlayerDead = new List<string>(new string[0]);
		GoodCatch = new List<string>(new string[0]);
		PlayerFallingSmall = new List<string>(new string[0]);
		PlayerFallingBig = new List<string>(new string[0]);
		PlayerHoldingMic = new List<string>(new string[0]);
		PlayerRagdoll = new List<string>(new string[0]);
		PlayerShroom = new List<string>(new string[0]);
		PlayerTookDamage = new List<string>(new string[0]);
		BombHeld = new List<string>(new string[0]);
		BombSeen = new List<string>(new string[0]);
		Interview = new List<string>(new string[0]);
		MultiMonster = new List<string>(new string[0]);
		BarnacleBall = new List<string>();
		BigSlapAggro = new List<string>();
		BigSlapPeaceful = new List<string>();
		Bombs = new List<string>();
		Ear = new List<string>();
		Flicker = new List<string>();
		Jello = new List<string>();
		Knifo = new List<string>();
		Larva = new List<string>();
		Mouth = new List<string>();
		Slurper = new List<string>();
		Snatcho = new List<string>();
		Spider = new List<string>();
		ToolkitWhisk = new List<string>();
		Weeping = new List<string>();
		WeepingCaptured = new List<string>();
		WeepingFailed = new List<string>();
		WeepingSuccess = new List<string>();
		Zombie = new List<string>();
		BlackHoleBot = new List<string>();
		CamCreep = new List<string>();
		Dog = new List<string>();
		EyeGuy = new List<string>();
		FireMonster = new List<string>();
		Harpooner = new List<string>();
		Mime = new List<string>();
		Puffo = new List<string>();
		RobotButton = new List<string>();
		SnailSpawner = new List<string>();
		Streamer = new List<string>();
		Wallo = new List<string>();
		Worm = new List<string>();
		PlayerHat = new Dictionary<string, List<string>>
		{
			{
				"Balaclava",
				new List<string>()
			},
			{
				"Beanie",
				new List<string>()
			},
			{
				"Bucket hat",
				new List<string>()
			},
			{
				"Cat ears",
				new List<string>()
			},
			{
				"Chefs hat",
				new List<string>()
			},
			{
				"Floppy hat",
				new List<string>()
			},
			{
				"Homburg",
				new List<string>()
			},
			{
				"Curly hair",
				new List<string>()
			},
			{
				"Bowler hat",
				new List<string>()
			},
			{
				"Cap",
				new List<string>()
			},
			{
				"Propeller hat",
				new List<string>()
			},
			{
				"Clown hair",
				new List<string>()
			},
			{
				"Cowboy hat",
				new List<string>()
			},
			{
				"Crown",
				new List<string>()
			},
			{
				"Halo",
				new List<string>()
			},
			{
				"Horns",
				new List<string>()
			},
			{
				"Hotdog hat",
				new List<string>()
			},
			{
				"Jesters hat",
				new List<string>()
			},
			{
				"Ghost hat",
				new List<string>()
			},
			{
				"Milk hat",
				new List<string>()
			},
			{
				"News cap",
				new List<string>()
			},
			{
				"Pirate hat",
				new List<string>()
			},
			{
				"Sports helmet",
				new List<string>()
			},
			{
				"Savannah hair",
				new List<string>()
			},
			{
				"Tooop hat",
				new List<string>()
			},
			{
				"Top hat",
				new List<string>()
			},
			{
				"Party hat",
				new List<string>()
			},
			{
				"Shroom hat",
				new List<string>()
			},
			{
				"Ushanka",
				new List<string>()
			},
			{
				"Witch hat",
				new List<string>()
			},
			{
				"Hard hat",
				new List<string>()
			}
		};
		PlayerDead.AddRange(PlayerDeadContentEvent.DEAD_COMMENTS);
		GoodCatch.AddRange(new GoodCatchContentEvent().GOOD_CATCH_COMMENTS);
		PlayerTookDamage.AddRange(PlayerTookDamageContentEvent.TOOK_DMG_COMMENTS);
		PlayerFallingSmall.AddRange(PlayerFallingContentEvent.SMALL_FALL_COMMENTS);
		PlayerFallingBig.AddRange(PlayerFallingContentEvent.BIG_FALL_COMMENTS);
		PlayerHoldingMic.AddRange(PlayerHoldingMicContentEvent.HOLDING_MIC_COMMENTS);
		PlayerRagdoll.AddRange(PlayerRagdollContentEvent.RAGDOLL_COMMENTS);
		PlayerShroom.AddRange(PlayerShroomContentEvent.comments);
		Interview.AddRange(new InterviewEvent().INTERVIEW_COMMENTS);
		MultiMonster.Add("I saw a bunch of monsters in this video! It was really cool!");
		BarnacleBall.AddRange(BarnacleBallContentEvent.NORMAL_COMMENTS);
		BigSlapAggro.AddRange(BigSlapAgroContentEvent.NORMAL_COMMENTS);
		BigSlapPeaceful.AddRange(BigSlapPeacefulContentEvent.NORMAL_COMMENTS);
		Bombs.AddRange(BombsContentEvent.NORMAL_COMMENTS);
		Ear.AddRange(EarContentEvent.NORMAL_COMMENTS);
		Flicker.AddRange(FlickerContentEvent.NORMAL_COMMENTS);
		Jello.AddRange(JelloContentEvent.NORMAL_COMMENTS);
		Knifo.AddRange(KnifoContentEvent.NORMAL_COMMENTS);
		Larva.AddRange(LarvaContentEvent.NORMAL_COMMENTS);
		Mouth.AddRange(MouthContentEvent.NORMAL_COMMENTS);
		Slurper.AddRange(SlurperContentEvent.NORMAL_COMMENTS);
		Snatcho.AddRange(SnatchoContentEvent.NORMAL_COMMENTS);
		Spider.AddRange(SpiderContentEvent.NORMAL_COMMENTS);
		ToolkitWhisk.AddRange(ToolkitWhiskContentEvent.NORMAL_COMMENTS);
		Weeping.AddRange(WeepingContentEvent.NORMAL_COMMENTS);
		WeepingCaptured.AddRange(WeepingContentEventCaptured.CAPTURED_COMMENTS);
		WeepingFailed.AddRange(WeepingContentEventFail.FAIL_COMMENTS);
		WeepingSuccess.AddRange(WeepingContentEventSuccess.SUCCESS_COMMENTS);
		Zombie.AddRange(ZombieContentEvent.NORMAL_COMMENTS);
		BlackHoleBot.AddRange(BlackHoleBotContentEvent.NORMAL_COMMENTS);
		CamCreep.AddRange(CamCreepContentEvent.NORMAL_COMMENTS);
		Dog.AddRange(DogContentEvent.NORMAL_COMMENTS);
		EyeGuy.AddRange(EyeGuyContentEvent.NORMAL_COMMENTS);
		FireMonster.AddRange(FireMonsterContentEvent.NORMAL_COMMENTS);
		Harpooner.AddRange(HarpoonerContentEvent.NORMAL_COMMENTS);
		Mime.AddRange(MimeContentEvent.NORMAL_COMMENTS);
		Puffo.AddRange(PuffoContentEvent.NORMAL_COMMENTS);
		RobotButton.AddRange(RobotButtonContentEvent.NORMAL_COMMENTS);
		SnailSpawner.AddRange(SnailSpawnerContentEvent.NORMAL_COMMENTS);
		Streamer.AddRange(StreamerContentEvent.NORMAL_COMMENTS);
		Wallo.AddRange(WalloContentEvent.NORMAL_COMMENTS);
		Worm.AddRange(WormContentEvent.NORMAL_COMMENTS);
	}
}
[BepInPlugin("me.excuze.CommentCustomizer", "CommentCustomizer", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	public static Plugin Instance;

	public static float Chance = 0.7f;

	private void Awake()
	{
		Instance = this;
		Harmony.CreateAndPatchAll(typeof(Plugin), (string)null);
		LoadComments();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin me.excuze.CommentCustomizer is loaded!");
	}

	public void LoadComments()
	{
		try
		{
			List<string> list = new List<string>();
			string[] collection = Directory.GetFiles(Path.Join((ReadOnlySpan<char>)Paths.PluginPath, (ReadOnlySpan<char>)"Excuze-FriendCommentCustomizer"), "*.cmt").ToArray();
			list.AddRange(collection);
			list.Sort();
			foreach (string item in list)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)("Loading custom comment resource file @ " + item));
				CommentConfig commentConfig = JsonConvert.DeserializeObject<CommentConfig>(File.ReadAllText(item));
				CustomComments.PlayerDead.AddRange(commentConfig.player_dead);
				CustomComments.GoodCatch.AddRange(commentConfig.good_catch);
				CustomComments.PlayerFallingSmall.AddRange(commentConfig.player_fall_small);
				CustomComments.PlayerFallingBig.AddRange(commentConfig.player_fall_big);
				CustomComments.PlayerHoldingMic.AddRange(commentConfig.player_hold_mic);
				CustomComments.PlayerRagdoll.AddRange(commentConfig.player_ragdoll);
				CustomComments.PlayerShroom.AddRange(commentConfig.player_shroom);
				CustomComments.Interview.AddRange(commentConfig.interview);
				CustomComments.MultiMonster.AddRange(commentConfig.multi_monster);
				CustomComments.BarnacleBall.AddRange(commentConfig.barnacle_ball);
				CustomComments.BigSlapAggro.AddRange(commentConfig.big_slap_aggro);
				CustomComments.BigSlapPeaceful.AddRange(commentConfig.big_slap_peaceful);
				CustomComments.Bombs.AddRange(commentConfig.bombs);
				CustomComments.Ear.AddRange(commentConfig.ear);
				CustomComments.Flicker.AddRange(commentConfig.flicker);
				CustomComments.Jello.AddRange(commentConfig.jello);
				CustomComments.Knifo.AddRange(commentConfig.knifo);
				CustomComments.Larva.AddRange(commentConfig.larva);
				CustomComments.Mouth.AddRange(commentConfig.mouth);
				CustomComments.Slurper.AddRange(commentConfig.slurper);
				CustomComments.Snatcho.AddRange(commentConfig.snatcho);
				CustomComments.Spider.AddRange(commentConfig.spider);
				CustomComments.ToolkitWhisk.AddRange(commentConfig.toolkit_whisk);
				CustomComments.Weeping.AddRange(commentConfig.weeping);
				CustomComments.WeepingCaptured.AddRange(commentConfig.weeping_captured);
				CustomComments.WeepingFailed.AddRange(commentConfig.weeping_failed);
				CustomComments.WeepingSuccess.AddRange(commentConfig.weeping_success);
				CustomComments.Zombie.AddRange(commentConfig.zombie);
				CustomComments.BlackHoleBot.AddRange(commentConfig.black_hole_bot);
				CustomComments.CamCreep.AddRange(commentConfig.cam_creep);
				CustomComments.Dog.AddRange(commentConfig.dog);
				CustomComments.EyeGuy.AddRange(commentConfig.eye_guy);
				CustomComments.FireMonster.AddRange(commentConfig.fire_monster);
				CustomComments.Harpooner.AddRange(commentConfig.harpooner);
				CustomComments.Mime.AddRange(commentConfig.mime);
				CustomComments.Puffo.AddRange(commentConfig.puffo);
				CustomComments.RobotButton.AddRange(commentConfig.robot_button);
				CustomComments.SnailSpawner.AddRange(commentConfig.snail_spawner);
				CustomComments.Streamer.AddRange(commentConfig.streamer);
				CustomComments.Wallo.AddRange(commentConfig.wallo);
				CustomComments.Worm.AddRange(commentConfig.worm);
				foreach (KeyValuePair<string, string[]> hat in commentConfig.hats)
				{
					if (CustomComments.PlayerHat.ContainsKey(hat.Key))
					{
						CustomComments.PlayerHat[hat.Key].AddRange(hat.Value);
					}
					else
					{
						Debug.LogWarning((object)("Did not recognize hat ID '" + hat.Key + "', cannot assign comments to it!"));
					}
				}
			}
		}
		catch (Exception ex)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)("!!! Failed while loading More Comments customization files:" + ex.StackTrace));
		}
	}

	[HarmonyPatch(typeof(PlayerDeadContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateComment(ref Comment __result, ref PlayerDeadContentEvent __instance)
	{
		__result.Text = ((PlayerBaseEvent)__instance).FixPlayerName(GetRandom(CustomComments.PlayerDead));
	}

	[HarmonyPatch(typeof(GoodCatchContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentA(ref Comment __result, ref GoodCatchContentEvent __instance)
	{
		__result.Text = ((PlayerBaseEvent)__instance).FixPlayerName(GetRandom(CustomComments.GoodCatch));
	}

	[HarmonyPatch(typeof(PlayerFallingContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentB(ref Comment __result, ref PlayerFallingContentEvent __instance)
	{
		if (__instance.sinceGrounded > PlayerRagdoll.RagdollIfFellForLongerThan)
		{
			__result.Text = ((PlayerBaseEvent)__instance).FixPlayerName(GetRandom(CustomComments.PlayerFallingBig));
		}
		else
		{
			__result.Text = ((PlayerBaseEvent)__instance).FixPlayerName(GetRandom(CustomComments.PlayerFallingSmall));
		}
	}

	[HarmonyPatch(typeof(PlayerHoldingMicContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentC(ref Comment __result, ref PlayerHoldingMicContentEvent __instance)
	{
		__result.Text = ((PlayerBaseEvent)__instance).FixPlayerName(GetRandom(CustomComments.PlayerHoldingMic));
	}

	[HarmonyPatch(typeof(PlayerRagdollContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentD(ref Comment __result, ref PlayerRagdollContentEvent __instance)
	{
		__result.Text = ((PlayerBaseEvent)__instance).FixPlayerName(GetRandom(CustomComments.PlayerRagdoll));
	}

	[HarmonyPatch(typeof(PlayerShroomContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentE(ref Comment __result, ref PlayerShroomContentEvent __instance)
	{
		__result.Text = ((PlayerBaseEvent)__instance).FixPlayerName(GetRandom(CustomComments.PlayerShroom));
	}

	[HarmonyPatch(typeof(PlayerTookDamageContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentF(ref Comment __result, ref PlayerTookDamageContentEvent __instance)
	{
		__result.Text = ((PlayerBaseEvent)__instance).FixPlayerName(GetRandom(CustomComments.PlayerTookDamage));
	}

	[HarmonyPatch(typeof(PlayerWearingHatContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentG(ref Comment __result, ref PlayerWearingHatContentEvent __instance)
	{
		object value = Traverse.Create((object)__instance).Field("hatInDatabase").GetValue();
		string displayName = ((Hat)((value is Hat) ? value : null)).displayName;
		if (CustomComments.PlayerHat.ContainsKey(displayName))
		{
			__result.Text = ((PlayerBaseEvent)__instance).FixPlayerName(GetRandom(CustomComments.PlayerHat[displayName]));
		}
	}

	[HarmonyPatch(typeof(BombContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentH(ref Comment __result, ref BombContentEvent __instance)
	{
		List<string> list = new List<string>();
		if (__instance.isHeld)
		{
			list.AddRange(CustomComments.BombHeld);
			list.Add(__result.Text);
			__result.Text = GetRandom(list);
		}
		else
		{
			list.AddRange(__instance.bombItem.content.comments);
			list.AddRange(CustomComments.BombSeen);
			__result.Text = GetRandom(list);
		}
	}

	[HarmonyPatch(typeof(InterviewEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentI(ref Comment __result, ref InterviewEvent __instance)
	{
		__result.Text = GetRandom(CustomComments.Interview);
	}

	[HarmonyPatch(typeof(MultiMonsterEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentJ(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.MultiMonster);
	}

	[HarmonyPatch(typeof(BarnacleBallContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMA(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.BarnacleBall);
	}

	[HarmonyPatch(typeof(BigSlapAgroContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMB(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.BigSlapAggro);
	}

	[HarmonyPatch(typeof(BigSlapPeacefulContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMC(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.BigSlapPeaceful);
	}

	[HarmonyPatch(typeof(BombsContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMD(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Bombs);
	}

	[HarmonyPatch(typeof(EarContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentME(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Ear);
	}

	[HarmonyPatch(typeof(FlickerContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMF(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Flicker);
	}

	[HarmonyPatch(typeof(JelloContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMG(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Jello);
	}

	[HarmonyPatch(typeof(KnifoContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMH(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Knifo);
	}

	[HarmonyPatch(typeof(LarvaContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMI(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Larva);
	}

	[HarmonyPatch(typeof(MouthContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMJ(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Mouth);
	}

	[HarmonyPatch(typeof(SlurperContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMK(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Slurper);
	}

	[HarmonyPatch(typeof(SnatchoContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentML(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Snatcho);
	}

	[HarmonyPatch(typeof(SpiderContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMM(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Spider);
	}

	[HarmonyPatch(typeof(ToolkitWhiskContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMN(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.ToolkitWhisk);
	}

	[HarmonyPatch(typeof(WeepingContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMO(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Weeping);
	}

	[HarmonyPatch(typeof(WeepingContentEventCaptured), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMP(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.WeepingCaptured);
	}

	[HarmonyPatch(typeof(WeepingContentEventFail), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMQ(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.WeepingFailed);
	}

	[HarmonyPatch(typeof(WeepingContentEventSuccess), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMR(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.WeepingSuccess);
	}

	[HarmonyPatch(typeof(ZombieContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMS(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Zombie);
	}

	[HarmonyPatch(typeof(BlackHoleBotContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMT(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.BlackHoleBot);
	}

	[HarmonyPatch(typeof(CamCreepContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMU(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.CamCreep);
	}

	[HarmonyPatch(typeof(DogContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMV(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Dog);
	}

	[HarmonyPatch(typeof(EyeGuyContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMW(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.EyeGuy);
	}

	[HarmonyPatch(typeof(FireMonsterContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMX(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.FireMonster);
	}

	[HarmonyPatch(typeof(HarpoonerContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMY(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Harpooner);
	}

	[HarmonyPatch(typeof(MimeContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMZ(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Mime);
	}

	[HarmonyPatch(typeof(PuffoContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMZA(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Puffo);
	}

	[HarmonyPatch(typeof(RobotButtonContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMZB(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.RobotButton);
	}

	[HarmonyPatch(typeof(SnailSpawnerContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMZC(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.SnailSpawner);
	}

	[HarmonyPatch(typeof(StreamerContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMZD(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Streamer);
	}

	[HarmonyPatch(typeof(WalloContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMZE(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Wallo);
	}

	[HarmonyPatch(typeof(WormContentEvent), "GenerateComment")]
	[HarmonyPostfix]
	private static void GenerateCommentMZF(ref Comment __result)
	{
		__result.Text = GetRandom(CustomComments.Worm);
	}

	[HarmonyPatch(typeof(HatDatabase), "MakeLocalizedHatNames")]
	[HarmonyPostfix]
	private static void MakeLocalizedHatNames(ref HatDatabase __instance)
	{
		Hat[] hats = __instance.hats;
		foreach (Hat val in hats)
		{
			CustomComments.PlayerHat[val.displayName].AddRange(val.comments);
		}
	}

	public static string GetRandom(List<string> array)
	{
		int num = Random.Range(0, array.Count);
		if (num > array.Count - 1)
		{
			num = array.Count - 1;
		}
		if (num < 0)
		{
			num = 0;
		}
		try
		{
			if (num < 0 || num >= array.Count)
			{
				return "";
			}
			return array[num];
		}
		catch (Exception)
		{
			return "";
		}
	}
}
public static class MyPluginInfo
{
	public const string PLUGIN_GUID = "CommentCustomizer";

	public const string PLUGIN_NAME = "CommentCustomizer";

	public const string PLUGIN_VERSION = "1.0.0";
}