Decompiled source of Silly Drones v1.0.0

SillyDrone.dll

Decompiled 7 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using TMPro;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SillyDrone")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SillyDrone")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3928e4f6-ead7-4975-9712-8539c0488396")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SillyDrones;

[BepInPlugin("Rissoe.SillyDrone", "Silly Drone", "1.0.0")]
public class SillyDrone : BaseUnityPlugin
{
	public const string modGUID = "Rissoe.SillyDrone";

	public const string modName = "Silly Drone";

	public const string modVersion = "1.0.0";

	public static ManualLogSource Logs = Logger.CreateLogSource("Rissoe.SillyDrone");

	public static ConfigEntry<string> FaceNeutral;

	public static ConfigEntry<string> FaceAngry;

	public static ConfigEntry<string> FaceAttack;

	private readonly Harmony harmony = new Harmony("Rissoe.SillyDrone");

	private void Awake()
	{
		harmony.PatchAll(typeof(Silly));
		FaceNeutral = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Neutral", ":3", "The face that is displayed when flying around.");
		FaceAngry = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Angry", ">:Ɛ", "The face that is displayed when running away after the drone landed.");
		FaceAttack = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Attack", ">:3", "The face that is displayed when attacking.");
		Logs.LogMessage((object)"Rissoe.SillyDrone has loaded succesfully.");
	}
}
[HarmonyPatch(typeof(Attacks_BlackHole))]
[HarmonyPatch("LocalCode")]
internal static class Silly
{
	[HarmonyPostfix]
	private static void Postfix(Attacks_BlackHole __instance)
	{
		if (((TMP_Text)__instance.texts[0]).text == ">:)")
		{
			for (int i = 0; i < __instance.texts.Length; i++)
			{
				((TMP_Text)__instance.texts[i]).text = SillyDrone.FaceNeutral.Value;
			}
		}
		else if (((TMP_Text)__instance.texts[0]).text == ">:(")
		{
			for (int j = 0; j < __instance.texts.Length; j++)
			{
				((TMP_Text)__instance.texts[j]).text = SillyDrone.FaceAngry.Value;
			}
		}
		else if (((TMP_Text)__instance.texts[0]).text == ">:D")
		{
			for (int k = 0; k < __instance.texts.Length; k++)
			{
				((TMP_Text)__instance.texts[k]).text = SillyDrone.FaceAttack.Value;
			}
		}
	}
}