Decompiled source of BETA LC VEGA v2.0.3

BepInEx/plugins/LC-VEGA.dll

Decompiled a year ago
using System;
using System.Collections;
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 BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LC_VEGA.Patches;
using LobbyCompatibility.Enums;
using LobbyCompatibility.Features;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using VoiceRecognitionAPI;
using com.github.zehsteam.ToilHead.MonoBehaviours;

[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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LC-VEGA")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+37a3235d9fa8670c8caea8e97f78579e2fd893e3")]
[assembly: AssemblyProduct("LC-VEGA")]
[assembly: AssemblyTitle("LC-VEGA")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace LC_VEGA
{
	public static class CoroutineManager
	{
		internal class CoroutineManagerBehaviour : MonoBehaviour
		{
		}

		private static MonoBehaviour _instance;

		private static MonoBehaviour instance
		{
			get
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_instance == (Object)null)
				{
					_instance = (MonoBehaviour)(object)new GameObject("CoroutineManager").AddComponent<CoroutineManagerBehaviour>();
				}
				return _instance;
			}
		}

		public static Coroutine StartCoroutine(IEnumerator routine)
		{
			return instance.StartCoroutine(routine);
		}
	}
	internal class ModChecker
	{
		public static bool hasToilHead;

		public static bool hasMalfunctions;

		public static bool hasDiveristy;

		public static bool hasCodeRebirth;

		public static bool CheckForMod(string modGUID)
		{
			Dictionary<string, PluginInfo> pluginInfos = Chainloader.PluginInfos;
			foreach (PluginInfo value in pluginInfos.Values)
			{
				if (value.Metadata.GUID.Equals(modGUID))
				{
					Plugin.LogToConsole("Found mod: " + value.Metadata.Name);
					return true;
				}
			}
			return false;
		}
	}
	[BepInPlugin("JS03.LC-VEGA", "LC-VEGA", "2.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "JS03.LC-VEGA";

		private const string modName = "LC-VEGA";

		private const string modVersion = "2.0.0";

		internal static AssetBundle assetBundle;

		public static ConfigEntry<VocalLevels> vocalLevel;

		public static ConfigEntry<bool> playIntro;

		public static ConfigEntry<bool> readBestiaryEntries;

		public static ConfigEntry<bool> giveWeatherInfo;

		public static ConfigEntry<bool> ignoreMasterVolume;

		public static ConfigEntry<string> messages;

		public static ConfigEntry<bool> enableAdvancedScannerAuto;

		public static ConfigEntry<bool> detectMasked;

		public static ConfigEntry<bool> useManualListening;

		public static ConfigEntry<bool> enableManualListeningAuto;

		public static ConfigEntry<float> confidence;

		public static ConfigEntry<bool> registerActivation;

		public static ConfigEntry<bool> registerMoonsInfo;

		public static ConfigEntry<bool> registerBestiaryEntries;

		public static ConfigEntry<bool> registerCreatureInfo;

		public static ConfigEntry<bool> registerAdvancedScanner;

		public static ConfigEntry<bool> registerInteractSecureDoor;

		public static ConfigEntry<bool> registerInteractAllSecureDoors;

		public static ConfigEntry<bool> registerDisableTurret;

		public static ConfigEntry<bool> registerDisableAllTurrets;

		public static ConfigEntry<bool> registerDisableMine;

		public static ConfigEntry<bool> registerDisableAllMines;

		public static ConfigEntry<bool> registerDisableSpikeTrap;

		public static ConfigEntry<bool> registerDisableAllSpikeTraps;

		public static ConfigEntry<bool> registerTeleporter;

		public static ConfigEntry<bool> registerRadarSwitch;

		public static ConfigEntry<bool> registerCrewStatus;

		public static ConfigEntry<bool> registerCrewInShip;

		public static ConfigEntry<bool> registerScrapLeft;

		public static ConfigEntry<bool> registerRadarBoosters;

		public static ConfigEntry<bool> registerSignalTranslator;

		public static ConfigEntry<bool> registerTime;

		public static ConfigEntry<bool> registerLeverPull;

		public static ConfigEntry<bool> registerInteractShipDoors;

		public static ConfigEntry<bool> registerInteractShipLights;

		public static ConfigEntry<bool> registerWeatherInfo;

		public static ConfigEntry<bool> registerStop;

		public static ConfigEntry<bool> registerThanks;

		private readonly Harmony harmony = new Harmony("JS03.LC-VEGA");

		private static Plugin Instance;

		internal static ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("JS03.LC-VEGA");
			mls.LogInfo((object)"The installation of VEGA has begun");
			LoadAssets();
			GenerateConfigValues();
			CheckInstalledMods();
			ManageSaveValues();
			VEGA.Initialize();
			PatchStuff();
		}

		internal void LoadAssets()
		{
			mls.LogInfo((object)"Loading assets");
			VEGA.voiceLines = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("LC-VEGA.dll".ToCharArray());
			assetBundle = AssetBundle.LoadFromFile(location + "lcvegavoicelines");
			if ((Object)(object)assetBundle != (Object)null)
			{
				VEGA.voiceLines = assetBundle.LoadAllAssets<AudioClip>().ToList();
				mls.LogInfo((object)"Assets loaded successfully");
			}
			else
			{
				mls.LogWarning((object)"Unable to load assets");
			}
		}

		internal void PatchStuff()
		{
			mls.LogInfo((object)"Patching things");
			harmony.PatchAll(typeof(Plugin));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			harmony.PatchAll(typeof(TerminalPatch));
			harmony.PatchAll(typeof(TimeOfDayPatch));
			harmony.PatchAll(typeof(HUDManagerPatch));
			harmony.PatchAll(typeof(GeneralPatches));
		}

		internal void CheckInstalledMods()
		{
			mls.LogInfo((object)"Looking for compatible mods...");
			if (ModChecker.CheckForMod("BMX.LobbyCompatibility"))
			{
				PluginHelper.RegisterPlugin("JS03.LC-VEGA", Version.Parse("2.0.0"), (CompatibilityLevel)0, (VersionStrictness)0);
			}
			ModChecker.hasToilHead = ModChecker.CheckForMod("com.github.zehsteam.ToilHead");
		}

		internal void ManageSaveValues()
		{
			mls.LogDebug((object)("Looking for: " + Application.persistentDataPath + SaveManager.fileName));
			SaveManager.playedIntro = false;
			SaveManager.firstTimeDiversity = true;
			if (File.Exists(Application.persistentDataPath + SaveManager.fileName))
			{
				mls.LogDebug((object)"File found. Loading values...");
				SaveManager.playedIntro = SaveManager.LoadFromFile(0);
				SaveManager.firstTimeDiversity = SaveManager.LoadFromFile(1);
			}
			else
			{
				mls.LogDebug((object)"File not found. Creating it now!");
				SaveManager.SaveToFile();
			}
		}

		internal void GenerateConfigValues()
		{
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			vocalLevel = ((BaseUnityPlugin)this).Config.Bind<VocalLevels>("Dialogue & Interactions", "Vocal Level", VocalLevels.High, "Changes how often VEGA speaks.\nNone: Will only speak when asked to.\nLow: Gives you useful info, doesn't talk on most interactions and new enemy scans. Recommended for more experienced players.\nMedium: Gives you useful info, doesn't talk on most interactions. Recommended for intermediate level players.\nHigh: The default value. Will speak on every interaction. Recommended for inexperienced players.");
			ignoreMasterVolume = ((BaseUnityPlugin)this).Config.Bind<bool>("Dialogue & Interactions", "Ignore Master Volume setting", false, "If set to true, VEGA will ignore the game's master volume setting and always play at the same volume level.\nThis setting only applies before joining a game.");
			playIntro = ((BaseUnityPlugin)this).Config.Bind<bool>("Dialogue & Interactions", "Play intro", true, "If set to true, VEGA will give you its introduction speech the first time you use the mod.");
			readBestiaryEntries = ((BaseUnityPlugin)this).Config.Bind<bool>("Dialogue & Interactions", "Read Bestiary entries", true, "If set to true, VEGA will read every bestiary entry you open in the terminal.");
			giveWeatherInfo = ((BaseUnityPlugin)this).Config.Bind<bool>("Dialogue & Interactions", "Give Weather info", true, "If set to true, VEGA will give you information on a moon's current weather upon landing if you have little to no experience.");
			messages = ((BaseUnityPlugin)this).Config.Bind<string>("Dialogue & Interactions", "Signal Translator messages", "YES, NO, OKAY, HELP, THANKS, ITEMS, MAIN, FIRE, GIANT, GIANTS, DOG, DOGS, WORM, WORMS, BABOONS, HAWKS, DANGER, GIRL, GHOST, BRACKEN, BUTLER, BUTLERS, BUG, BUGS, YIPPEE, SNARE, FLEA, COIL, JESTER, SLIME, THUMPER, MIMIC, MIMICS, MASKED, SPIDER, SNAKES, OLD BIRD, HEROBRINE, FOOTBALL, FIEND, SLENDER, LOCKER, SHY GUY, SIRENHEAD, DRIFTWOOD, WALKER, WATCHER, INSIDE, TRAPPED, LEAVE, GOLD, APPARATUS", "The messages VEGA can transmit using the Signal Translator.\nEach message must be separated by a comma and a white space, like so -> 'Message, Another message'\nApplies after a game restart.");
			enableAdvancedScannerAuto = ((BaseUnityPlugin)this).Config.Bind<bool>("Advanced Scanner", "Enable the Advanced Scanner automatically", false, "Enables VEGA's Advanced Scanner automatically when joining a game. Useful if you always want to have it on and don't want to repeat the voice command often. Applies after restarting the game.");
			detectMasked = ((BaseUnityPlugin)this).Config.Bind<bool>("Advanced Scanner", "Detect Masked employees", false, "Determines if the Advanced Scanner should be able to count Masked employees as entities.");
			confidence = ((BaseUnityPlugin)this).Config.Bind<float>("Voice Recognition", "Confidence", 0.7f, new ConfigDescription("Determines how easy / hard it is for VEGA to recognize voice commands. Higher values means he needs to be more confident, lower values will activate more often, but will cause more false positives. If VEGA doesn't pick you up, try lowering this value.\nCan be changed mid-game.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			useManualListening = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Manual Listening", false, "Determines if VEGA should only be able to hear you when you ask him to.");
			enableManualListeningAuto = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Enable VEGA listening automatically", false, "Makes VEGA listen automatically when joining a game. Only works if Manual Listening is set to true. Applies after restarting the game.");
			registerActivation = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Manual Listening commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerMoonsInfo = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Moon info commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerBestiaryEntries = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Bestiary entries commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerCreatureInfo = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Creature info commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerAdvancedScanner = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Advanced Scanner commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerInteractSecureDoor = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Open / Close Secure Door commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerInteractAllSecureDoors = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Open / Close All Secure Doors command", true, "Disable this if you don't want this voice command to be registered. Will apply after restarting the game.");
			registerDisableTurret = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Disable Turret command", true, "Disable this if you don't want this voice command to be registered. Will apply after restarting the game.");
			registerDisableAllTurrets = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Disable All Turrets command", true, "Disable this if you don't want this voice command to be registered. Will apply after restarting the game.");
			registerDisableMine = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Disable Mine command", true, "Disable this if you don't want this voice command to be registered. Will apply after restarting the game.");
			registerDisableAllMines = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Disable All Mines command", true, "Disable this if you don't want this voice command to be registered. Will apply after restarting the game.");
			registerDisableSpikeTrap = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Disable Spike Trap command", true, "Disable this if you don't want this voice command to be registered. Will apply after restarting the game.");
			registerDisableAllSpikeTraps = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Disable All Spike Traps command", true, "Disable this if you don't want this voice command to be registered. Will apply after restarting the game.");
			registerTeleporter = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Teleporter commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerRadarSwitch = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Radar Switch commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerCrewStatus = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Crew Status commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerCrewInShip = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Crew in ship commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerScrapLeft = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Scrap / items left commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerRadarBoosters = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Radar Booster commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerSignalTranslator = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Signal Translator commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerTime = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Current time of day commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerInteractShipDoors = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Ship Door commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerInteractShipLights = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Ship Lights commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerWeatherInfo = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Weather info commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerStop = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Stop Talking commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
			registerThanks = ((BaseUnityPlugin)this).Config.Bind<bool>("Voice Recognition", "Register Thank you commands", true, "Disable this if you don't want these voice commands to be registered. Will apply after restarting the game.");
		}

		public static void LogToConsole(string message, string logType = "")
		{
			switch (logType.ToLower())
			{
			case "warn":
				mls.LogWarning((object)message);
				break;
			case "error":
				mls.LogError((object)message);
				break;
			case "debug":
				mls.LogDebug((object)message);
				break;
			default:
				mls.LogInfo((object)message);
				break;
			}
		}
	}
	internal class SaveManager
	{
		public static string fileName = "\\VEGA_Interactions.bin";

		public static bool playedIntro;

		public static bool firstTimeDiversity;

		public static void SaveToFile()
		{
			using BinaryWriter binaryWriter = new BinaryWriter(File.Open(Application.persistentDataPath + fileName, FileMode.Create));
			binaryWriter.Write(playedIntro);
			binaryWriter.Write(firstTimeDiversity);
		}

		public static bool LoadFromFile(int index)
		{
			using BinaryReader binaryReader = new BinaryReader(File.Open(Application.persistentDataPath + fileName, FileMode.Open));
			if (binaryReader.BaseStream.Position == index)
			{
				return binaryReader.ReadBoolean();
			}
			return false;
		}
	}
	internal class VEGA
	{
		public static AudioSource audioSource;

		public static List<AudioClip> voiceLines;

		public static bool listening;

		public static bool shouldBeInterrupted;

		public static bool warningGiven;

		public static bool facilityHasPower;

		public static bool performAdvancedScan;

		public static float teleporterCooldownTime;

		public static TextMeshProUGUI enemiesText;

		public static TextMeshProUGUI itemsText;

		public static char creditsChar;

		internal static string enemiesTopText;

		internal static string itemsTopText;

		internal static float scannerRange;

		internal static bool turretsExist;

		internal static bool turretDisabled;

		internal static bool noVisibleTurret;

		internal static bool noTurretNearby;

		internal static bool noTurrets;

		internal static float distanceToTurret;

		internal static bool toilDisabled;

		internal static bool noToils;

		internal static float distanceToToil;

		public static string[] signals;

		public static string[] weathers = new string[5] { "Foggy", "Rainy", "Stormy", "Flooded", "Eclipsed" };

		public static Dictionary<int, string> enemies = new Dictionary<int, string>
		{
			{ 0, "SnareFlea" },
			{ 1, "Bracken" },
			{ 2, "Thumper" },
			{ 3, "EyelessDog" },
			{ 4, "YippeeBug" },
			{ 5, "Slime" },
			{ 6, "ForestKeeper" },
			{ 7, "Coil-Head" },
			{ 9, "Sandworm" },
			{ 10, "Jester" },
			{ 11, "SporeLizard" },
			{ 12, "BunkerSpider" },
			{ 13, "Manticoil" },
			{ 14, "RedBees" },
			{ 15, "Locusts" },
			{ 16, "BaboonHawk" },
			{ 17, "Nutcracker" },
			{ 18, "OldBird" },
			{ 19, "Butler" },
			{ 21, "Snakes" }
		};

		public static string[] moddedEnemies = new string[14]
		{
			"RedWood Giant", "Stalker", "DriftWood Giant", "Football", "Shy guy", "Locker", "Siren Head", "Rolling Giant", "Peepers", "Shockwave Drone",
			"Cleaning Drone", "Moving Turret", "Maggie", "Shrimp"
		};

		public static void PlayIntro()
		{
			if ((Object)(object)audioSource != (Object)null)
			{
				if (audioSource.isPlaying)
				{
					return;
				}
				Plugin.LogToConsole("Playing intro audio");
				foreach (AudioClip voiceLine in voiceLines)
				{
					if (((Object)voiceLine).name.Equals("Intro"))
					{
						audioSource.clip = voiceLine;
					}
				}
				audioSource.PlayDelayed(4.5f);
				SaveManager.playedIntro = true;
			}
			else
			{
				Plugin.LogToConsole("Unable to play intro audio. The audio source for VEGA does not exist", "error");
			}
		}

		public static void PlayListeningSoundOnStart(float delay = 3.5f)
		{
			if ((Object)(object)audioSource != (Object)null)
			{
				if (audioSource.isPlaying)
				{
					return;
				}
				Plugin.LogToConsole("Playing audio");
				foreach (AudioClip voiceLine in voiceLines)
				{
					if (((Object)voiceLine).name.Equals("Activate"))
					{
						audioSource.clip = voiceLine;
					}
				}
				audioSource.PlayDelayed(delay);
				SaveManager.playedIntro = true;
			}
			else
			{
				Plugin.LogToConsole("Unable to play the activation sound effect. The audio source for VEGA does not exist", "error");
			}
		}

		public static void PlayAudio(string clipName, float delay = 0.25f)
		{
			if ((Object)(object)audioSource != (Object)null)
			{
				if (StartOfRound.Instance.localPlayerController.isPlayerDead || audioSource.isPlaying)
				{
					return;
				}
				Plugin.LogToConsole("Playing audio");
				foreach (AudioClip voiceLine in voiceLines)
				{
					if (((Object)voiceLine).name.Equals(clipName))
					{
						audioSource.clip = voiceLine;
					}
				}
				audioSource.PlayDelayed(delay);
			}
			else
			{
				Plugin.LogToConsole("Unable to play audio. The audio source for VEGA does not exist", "error");
			}
		}

		public static void PlayAudioWithVariant(string clipName, int range, float delay = 0.25f)
		{
			clipName = clipName + "-" + range;
			PlayAudio(clipName, delay);
		}

		internal static bool ClientHasMoon(string moonName)
		{
			SelectableLevel[] levels = StartOfRound.Instance.levels;
			foreach (SelectableLevel val in levels)
			{
				if (val.PlanetName.Equals(moonName))
				{
					return true;
				}
			}
			PlayAudioWithVariant("NoInfoOnMoon", Random.Range(1, 4));
			return false;
		}

		internal static void OpenSecureDoor()
		{
			//IL_005c: 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)
			if (StartOfRound.Instance.localPlayerController.isInsideFactory)
			{
				if (!facilityHasPower)
				{
					PlayAudioWithVariant("NoPower", Random.Range(1, 4));
					return;
				}
				TerminalAccessibleObject closestSecureDoor = GetClosestSecureDoor();
				if (!((Object)(object)closestSecureDoor != (Object)null))
				{
					return;
				}
				if (Vector3.Distance(((Component)closestSecureDoor).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position) < 11f)
				{
					Plugin.LogToConsole("Opening door", "debug");
					closestSecureDoor.SetDoorLocalClient(true);
					if (Plugin.vocalLevel.Value >= VocalLevels.High)
					{
						PlayAudioWithVariant("DoorOpened", Random.Range(1, 4), 0.7f);
					}
				}
				else
				{
					PlayAudio("NoDoorNearby");
				}
			}
			else
			{
				PlayAudioWithVariant("IndoorsOnly", Random.Range(1, 4));
			}
		}

		internal static void OpenAllDoors()
		{
			bool flag = false;
			if (!facilityHasPower)
			{
				PlayAudioWithVariant("NoPower", Random.Range(1, 4));
				return;
			}
			TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array2 = array;
			foreach (TerminalAccessibleObject val in array2)
			{
				if (val.isBigDoor)
				{
					val.SetDoorLocalClient(true);
					flag = true;
				}
			}
			if (flag)
			{
				Plugin.LogToConsole("Opening all doors", "debug");
				if (Plugin.vocalLevel.Value >= VocalLevels.High)
				{
					PlayAudioWithVariant("AllDoorsOpened", Random.Range(1, 3), 0.7f);
				}
			}
			else
			{
				PlayAudio("NoDoors");
			}
		}

		internal static void CloseSecureDoor()
		{
			//IL_005c: 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)
			if (StartOfRound.Instance.localPlayerController.isInsideFactory)
			{
				if (!facilityHasPower)
				{
					PlayAudioWithVariant("NoPower", Random.Range(1, 4));
					return;
				}
				TerminalAccessibleObject closestSecureDoor = GetClosestSecureDoor();
				if (!((Object)(object)closestSecureDoor != (Object)null))
				{
					return;
				}
				if (Vector3.Distance(((Component)closestSecureDoor).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position) < 11f)
				{
					Plugin.LogToConsole("Closing door", "debug");
					closestSecureDoor.SetDoorLocalClient(false);
					if (Plugin.vocalLevel.Value >= VocalLevels.High)
					{
						PlayAudioWithVariant("DoorClosed", Random.Range(1, 4), 0.7f);
					}
				}
				else
				{
					PlayAudio("NoDoorNearby");
				}
			}
			else
			{
				PlayAudioWithVariant("IndoorsOnly", Random.Range(1, 4));
			}
		}

		internal static void CloseAllDoors()
		{
			bool flag = false;
			if (!facilityHasPower)
			{
				PlayAudioWithVariant("NoPower", Random.Range(1, 4));
				return;
			}
			TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array2 = array;
			foreach (TerminalAccessibleObject val in array2)
			{
				if (val.isBigDoor)
				{
					val.SetDoorLocalClient(false);
					flag = true;
				}
			}
			if (flag)
			{
				Plugin.LogToConsole("Closing all doors", "debug");
				if (Plugin.vocalLevel.Value >= VocalLevels.High)
				{
					PlayAudioWithVariant("AllDoorsClosed", Random.Range(1, 3), 0.7f);
				}
			}
			else
			{
				PlayAudio("NoDoors");
			}
		}

		internal static TerminalAccessibleObject? GetClosestSecureDoor()
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			Plugin.LogToConsole("Getting closest secure door", "debug");
			TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
			List<TerminalAccessibleObject> list = new List<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array2 = array;
			foreach (TerminalAccessibleObject val in array2)
			{
				if (val.isBigDoor)
				{
					list.Add(val);
				}
			}
			if (list.Count() == 0)
			{
				PlayAudio("NoDoors");
				return null;
			}
			TerminalAccessibleObject result = list[0];
			List<float> list2 = new List<float>();
			float num = 0f;
			foreach (TerminalAccessibleObject item in list)
			{
				num = Vector3.Distance(((Component)item).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position);
				list2.Add(num);
				if (num <= list2.Min())
				{
					result = item;
				}
			}
			return result;
		}

		internal static TerminalAccessibleObject? GetClosestTurret()
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			Plugin.LogToConsole("Getting closest turret", "debug");
			List<TerminalAccessibleObject> list = new List<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array2 = array;
			foreach (TerminalAccessibleObject val in array2)
			{
				if (Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponent<Turret>()))
				{
					list.Add(val);
				}
			}
			if (list.Count() == 0)
			{
				noTurrets = true;
				return null;
			}
			TerminalAccessibleObject result = list[0];
			List<float> list2 = new List<float>();
			float num = 0f;
			foreach (TerminalAccessibleObject item in list)
			{
				num = Vector3.Distance(((Component)item).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position);
				list2.Add(num);
				if (num <= list2.Min())
				{
					result = item;
				}
			}
			distanceToTurret = list2.Min();
			return result;
		}

		internal static FollowTerminalAccessibleObjectBehaviour? GetClosestToil()
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			Plugin.LogToConsole("Getting closest toil", "debug");
			List<FollowTerminalAccessibleObjectBehaviour> list = new List<FollowTerminalAccessibleObjectBehaviour>();
			FollowTerminalAccessibleObjectBehaviour[] array = Object.FindObjectsOfType<FollowTerminalAccessibleObjectBehaviour>();
			FollowTerminalAccessibleObjectBehaviour[] array2 = array;
			foreach (FollowTerminalAccessibleObjectBehaviour item in array2)
			{
				list.Add(item);
			}
			if (list.Count() == 0)
			{
				noToils = true;
				return null;
			}
			FollowTerminalAccessibleObjectBehaviour result = list[0];
			List<float> list2 = new List<float>();
			float num = 0f;
			foreach (FollowTerminalAccessibleObjectBehaviour item2 in list)
			{
				num = Vector3.Distance(((Component)item2).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position);
				list2.Add(num);
				if (num <= list2.Min())
				{
					result = item2;
				}
			}
			distanceToToil = list2.Min();
			return result;
		}

		internal static void DisableTurret()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			TerminalAccessibleObject closestTurret = GetClosestTurret();
			if (!((Object)(object)closestTurret != (Object)null))
			{
				return;
			}
			if (Vector3.Distance(((Component)closestTurret).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position) < 51f)
			{
				if (StartOfRound.Instance.localPlayerController.HasLineOfSightToPosition(((Component)closestTurret).transform.position, 45f, 240, -1f))
				{
					Plugin.LogToConsole("Disabling turret", "debug");
					closestTurret.CallFunctionFromTerminal();
					turretDisabled = true;
				}
				else
				{
					noVisibleTurret = true;
				}
			}
			else
			{
				noTurretNearby = true;
			}
		}

		internal static void DisableToil()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			FollowTerminalAccessibleObjectBehaviour closestToil = GetClosestToil();
			TerminalAccessibleObject closestTurret = GetClosestTurret();
			if ((Object)(object)closestToil == (Object)null)
			{
				toilDisabled = false;
				return;
			}
			if ((Object)(object)closestTurret == (Object)null)
			{
				distanceToTurret = distanceToToil + 10f;
			}
			if (Vector3.Distance(((Component)closestToil).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position) < 51f && distanceToToil < distanceToTurret)
			{
				if (StartOfRound.Instance.localPlayerController.HasLineOfSightToPosition(((Component)closestToil).transform.position, 45f, 240, -1f))
				{
					Plugin.LogToConsole("Disabling toil turret", "debug");
					closestToil.CallFunctionFromTerminal();
					toilDisabled = true;
					turretDisabled = true;
				}
				else
				{
					noVisibleTurret = true;
					toilDisabled = false;
				}
			}
			else
			{
				noTurretNearby = true;
				toilDisabled = false;
			}
		}

		internal static void PlayTurretAudio()
		{
			if (turretDisabled)
			{
				if (Plugin.vocalLevel.Value >= VocalLevels.High)
				{
					PlayAudioWithVariant("TurretDisabled", Random.Range(1, 4), 0.7f);
				}
			}
			else if (noVisibleTurret)
			{
				PlayAudio("NoVisibleTurret");
			}
			else if (noTurretNearby)
			{
				PlayAudio("NoTurretNearby");
			}
			else if (noTurrets && noToils)
			{
				PlayAudio("NoTurrets");
			}
		}

		internal static void DisableAllTurrets()
		{
			Plugin.LogToConsole("Disabling all turrets", "debug");
			TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array2 = array;
			foreach (TerminalAccessibleObject val in array2)
			{
				if (Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponent<Turret>()))
				{
					val.CallFunctionFromTerminal();
					turretsExist = true;
				}
			}
			if (turretsExist)
			{
				if (Plugin.vocalLevel.Value >= VocalLevels.High)
				{
					PlayAudioWithVariant("AllTurretsDisabled", Random.Range(1, 4), 0.7f);
				}
			}
			else
			{
				PlayAudio("NoTurrets");
			}
		}

		internal static void DisableAllToils()
		{
			Plugin.LogToConsole("Disabling all toils", "debug");
			FollowTerminalAccessibleObjectBehaviour[] array = Object.FindObjectsOfType<FollowTerminalAccessibleObjectBehaviour>();
			FollowTerminalAccessibleObjectBehaviour[] array2 = array;
			foreach (FollowTerminalAccessibleObjectBehaviour val in array2)
			{
				turretsExist = true;
				val.CallFunctionFromTerminal();
			}
		}

		internal static TerminalAccessibleObject? GetClosestMine()
		{
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			Plugin.LogToConsole("Getting closest landmine", "debug");
			TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
			List<TerminalAccessibleObject> list = new List<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array2 = array;
			foreach (TerminalAccessibleObject val in array2)
			{
				if (Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponent<Landmine>()))
				{
					list.Add(val);
				}
			}
			if (list.Count() == 0)
			{
				PlayAudio("NoMines");
				return null;
			}
			TerminalAccessibleObject result = list[0];
			List<float> list2 = new List<float>();
			float num = 0f;
			foreach (TerminalAccessibleObject item in list)
			{
				num = Vector3.Distance(((Component)item).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position);
				list2.Add(num);
				if (num <= list2.Min())
				{
					result = item;
				}
			}
			return result;
		}

		internal static void DisableMine()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			TerminalAccessibleObject closestMine = GetClosestMine();
			if (!((Object)(object)closestMine != (Object)null))
			{
				return;
			}
			if (Vector3.Distance(((Component)closestMine).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position) < 11f)
			{
				Plugin.LogToConsole("Disabling landmine", "debug");
				closestMine.CallFunctionFromTerminal();
				if (Plugin.vocalLevel.Value >= VocalLevels.High)
				{
					PlayAudioWithVariant("MineDisabled", Random.Range(1, 4));
				}
			}
			else
			{
				PlayAudio("NoMineNearby");
			}
		}

		internal static void DisableAllMines()
		{
			bool flag = false;
			Plugin.LogToConsole("Disabling all landmines", "debug");
			TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array2 = array;
			foreach (TerminalAccessibleObject val in array2)
			{
				if (Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponent<Landmine>()))
				{
					val.CallFunctionFromTerminal();
					flag = true;
				}
			}
			if (flag)
			{
				if (Plugin.vocalLevel.Value >= VocalLevels.Low)
				{
					PlayAudioWithVariant("AllMinesDisabled", Random.Range(1, 4));
				}
			}
			else
			{
				PlayAudio("NoMines");
			}
		}

		internal static TerminalAccessibleObject? GetClosestSpikeTrap()
		{
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			Plugin.LogToConsole("Getting closest spike trap", "debug");
			TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
			List<TerminalAccessibleObject> list = new List<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array2 = array;
			foreach (TerminalAccessibleObject val in array2)
			{
				if ((Object)(object)((Component)val).gameObject.transform.parent != (Object)null && ((Object)((Component)val).gameObject.transform.parent).name.Equals("Container"))
				{
					list.Add(val);
				}
			}
			if (list.Count() == 0)
			{
				PlayAudio("NoTraps");
				return null;
			}
			TerminalAccessibleObject result = list[0];
			List<float> list2 = new List<float>();
			float num = 0f;
			foreach (TerminalAccessibleObject item in list)
			{
				num = Vector3.Distance(((Component)item).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position);
				list2.Add(num);
				if (num <= list2.Min())
				{
					result = item;
				}
			}
			return result;
		}

		internal static void DisableSpikeTrap()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			TerminalAccessibleObject closestSpikeTrap = GetClosestSpikeTrap();
			if (!((Object)(object)closestSpikeTrap != (Object)null))
			{
				return;
			}
			if (Vector3.Distance(((Component)closestSpikeTrap).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position) < 11f)
			{
				Plugin.LogToConsole("Disabling spike trap", "debug");
				closestSpikeTrap.CallFunctionFromTerminal();
				if (Plugin.vocalLevel.Value >= VocalLevels.Low)
				{
					PlayAudioWithVariant("TrapDisabled", Random.Range(1, 4));
				}
			}
			else
			{
				PlayAudio("NoTrapNearby");
			}
		}

		internal static void DisableAllSpikeTraps()
		{
			bool flag = false;
			Plugin.LogToConsole("Disabling all spike traps", "debug");
			TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
			TerminalAccessibleObject[] array2 = array;
			foreach (TerminalAccessibleObject val in array2)
			{
				if ((Object)(object)((Component)val).gameObject.transform.parent != (Object)null && ((Object)((Component)val).gameObject.transform.parent).name.Equals("Container"))
				{
					val.CallFunctionFromTerminal();
					flag = true;
				}
			}
			if (flag)
			{
				if (Plugin.vocalLevel.Value >= VocalLevels.Low)
				{
					PlayAudioWithVariant("AllTrapsDisabled", Random.Range(1, 4));
				}
			}
			else
			{
				PlayAudio("NoTraps");
			}
		}

		internal static void ActivateTeleporter()
		{
			if (Object.op_Implicit((Object)(object)GameObject.Find("Teleporter(Clone)")))
			{
				ShipTeleporter component = GameObject.Find("Teleporter(Clone)").GetComponent<ShipTeleporter>();
				if (teleporterCooldownTime <= 0f)
				{
					if (Plugin.vocalLevel.Value >= VocalLevels.High)
					{
						PlayAudioWithVariant("Teleport", Random.Range(1, 4));
					}
					component.PressTeleportButtonServerRpc();
				}
				else
				{
					PlayAudio("TeleporterOnCooldown");
					Plugin.LogToConsole("The teleporter is on cooldown!", "warn");
				}
			}
			else
			{
				PlayAudioWithVariant("NoTeleporter", Random.Range(1, 4));
			}
		}

		internal static IEnumerator SwitchLights(bool on)
		{
			ShipLights shipLights = Object.FindObjectOfType<ShipLights>();
			if (!((Object)(object)shipLights != (Object)null))
			{
				yield break;
			}
			if (on)
			{
				if (shipLights.areLightsOn)
				{
					PlayAudio("LightsAlreadyOn");
				}
				else
				{
					PlayAudio("LightsOn");
				}
			}
			else if (!shipLights.areLightsOn)
			{
				PlayAudio("LightsAlreadyOff");
			}
			else
			{
				PlayAudio("LightsOff");
			}
			yield return (object)new WaitForSeconds(2f);
			shipLights.SetShipLightsServerRpc(on);
		}

		public static void PerformAdvancedScan()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if (!performAdvancedScan)
			{
				return;
			}
			Vector3 position = ((Component)StartOfRound.Instance.localPlayerController).transform.position;
			int num = 0;
			int num2 = 0;
			float num3 = 0f;
			Collider[] array = Physics.OverlapSphere(position, scannerRange);
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				GrabbableObject component = ((Component)val).GetComponent<GrabbableObject>();
				if ((Object)(object)component != (Object)null)
				{
					if (component.itemProperties.isScrap && !component.isHeld)
					{
						num2++;
						num3 += (float)component.scrapValue;
					}
					continue;
				}
				ScanNodeProperties component2 = ((Component)val).GetComponent<ScanNodeProperties>();
				if ((Object)(object)component2 != (Object)null && component2.creatureScanID != -1)
				{
					if (component2.creatureScanID == 18)
					{
						num++;
						continue;
					}
					EnemyAI val2 = ((Component)((Component)component2).transform.parent).GetComponent<EnemyAI>();
					if ((Object)(object)val2 == (Object)null)
					{
						val2 = ((Component)((Component)component2).transform.parent).GetComponent<EnemyAICollisionDetect>()?.mainScript;
					}
					if ((Object)(object)val2 != (Object)null && !val2.isEnemyDead && ((object)val2).GetType() != typeof(DocileLocustBeesAI) && ((object)val2).GetType() != typeof(DoublewingAI) && ((object)val2).GetType() != typeof(SandWormAI))
					{
						num++;
					}
				}
				else if (Plugin.detectMasked.Value)
				{
					MaskedPlayerEnemy component3 = ((Component)val).GetComponent<MaskedPlayerEnemy>();
					if (component3 != null && !((EnemyAI)component3).isEnemyDead)
					{
						num++;
					}
				}
			}
			switch (num)
			{
			case 0:
				((TMP_Text)enemiesText).SetText(enemiesTopText + "<color=blue>Clear</color>", true);
				break;
			case 1:
				((TMP_Text)enemiesText).SetText(enemiesTopText + "<color=red>1 entity nearby</color>", true);
				break;
			default:
				((TMP_Text)enemiesText).SetText(enemiesTopText + "<color=red>" + num + " entities nearby</color>", true);
				break;
			}
			switch (num2)
			{
			case 0:
				((TMP_Text)itemsText).SetText(itemsTopText + "<color=blue>Clear</color>", true);
				break;
			case 1:
				((TMP_Text)itemsText).SetText(itemsTopText + "<color=green>1 item nearby, worth " + creditsChar + num3 + "</color>", true);
				break;
			default:
				((TMP_Text)itemsText).SetText(itemsTopText + "<color=green>" + num2 + " items nearby, worth " + creditsChar + num3 + "</color>", true);
				break;
			}
		}

		internal static void GetDayMode()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected I4, but got Unknown
			DayMode dayMode = TimeOfDay.Instance.dayMode;
			DayMode val = dayMode;
			switch (val - -1)
			{
			case 0:
				PlayAudio("None");
				Plugin.LogToConsole("No day mode found", "warn");
				break;
			case 1:
				PlayAudio("Dawn");
				break;
			case 2:
				PlayAudio("Noon");
				break;
			case 3:
				PlayAudio("Sundown");
				break;
			case 4:
				PlayAudio("Midnight");
				break;
			default:
				PlayAudio("None");
				Plugin.LogToConsole("No day mode found", "warn");
				break;
			}
		}

		internal static RadarBoosterItem? GetClosestRadarBooster()
		{
			//IL_0054: 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)
			RadarBoosterItem[] array = Object.FindObjectsOfType<RadarBoosterItem>();
			if (array.Count() == 0)
			{
				PlayAudio("NoBoosters");
				return null;
			}
			RadarBoosterItem result = array[0];
			List<float> list = new List<float>();
			float num = 0f;
			RadarBoosterItem[] array2 = array;
			foreach (RadarBoosterItem val in array2)
			{
				num = Vector3.Distance(((Component)val).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position);
				list.Add(num);
				if (num <= list.Min())
				{
					result = val;
				}
			}
			return result;
		}

		internal static void InteractWithBooster(bool ping)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			RadarBoosterItem closestBooster = GetClosestRadarBooster();
			if (!((Object)(object)closestBooster != (Object)null) || !closestBooster.radarEnabled)
			{
				return;
			}
			if (Vector3.Distance(((Component)closestBooster).transform.position, ((Component)StartOfRound.Instance.localPlayerController).transform.position) < 16f)
			{
				int num = StartOfRound.Instance.mapScreen.radarTargets.FindIndex((TransformAndName target) => (Object)(object)target.transform == (Object)(object)((Component)closestBooster).transform);
				if (ping)
				{
					Plugin.LogToConsole("Pinging " + closestBooster.radarBoosterName);
					StartOfRound.Instance.mapScreen.PingRadarBooster(num);
				}
				else
				{
					Plugin.LogToConsole("Flashing " + closestBooster.radarBoosterName);
					StartOfRound.Instance.mapScreen.FlashRadarBooster(num);
				}
			}
			else
			{
				PlayAudio("NoBoostersNearby");
			}
		}

		internal static IEnumerator GetCrewStatus(float delay = 5f)
		{
			int deadPlayers = 0;
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB player in allPlayerScripts)
			{
				if (player.isPlayerDead)
				{
					deadPlayers++;
				}
			}
			if (StartOfRound.Instance.livingPlayers == 1 && deadPlayers == 0)
			{
				PlayAudio("SoloCrew");
				yield break;
			}
			PlayAudio("GettingCrewStatus");
			yield return (object)new WaitForSeconds(delay);
			string header = "CREW STATUS REPORT:";
			string livingPlayers2 = StartOfRound.Instance.livingPlayers + " employees alive\n";
			string deceasedPlayers = deadPlayers + " deceased employees";
			if (deadPlayers == 1)
			{
				deceasedPlayers = "1 deceased employee\n";
			}
			if (StartOfRound.Instance.livingPlayers == 1)
			{
				PlayAudio("GoodLuck", 2.5f);
				livingPlayers2 = "1 employee alive\n";
				HUDManager.Instance.DisplayTip(header, livingPlayers2 + deceasedPlayers, true, false, "LC_Tip1");
				yield break;
			}
			if (Plugin.vocalLevel.Value >= VocalLevels.High)
			{
				PlayAudioWithVariant("ReportComplete", Random.Range(1, 4));
			}
			HUDManager.Instance.DisplayTip(header, livingPlayers2 + deceasedPlayers, false, false, "LC_Tip1");
		}

		internal static IEnumerator GetCrewInShip(float delay = 5f)
		{
			int deadPlayers = 0;
			List<string> playersInShip = new List<string>();
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB player in allPlayerScripts)
			{
				if (player.isInHangarShipRoom)
				{
					playersInShip.Add(player.playerUsername);
				}
				if (player.isPlayerDead)
				{
					deadPlayers++;
				}
			}
			if (StartOfRound.Instance.livingPlayers == 1 && deadPlayers == 0)
			{
				if (playersInShip.Count <= 0)
				{
				}
				yield break;
			}
			yield return (object)new WaitForSeconds(delay);
			string header = "CREWMATES IN THE SHIP:";
			string body = "";
			if (playersInShip.Count == 0)
			{
				body = "No one is in the ship.";
			}
			else
			{
				foreach (string playerName in playersInShip)
				{
					body = ((!(playersInShip.Last() == playerName)) ? (body + playerName + ", ") : (body + playerName));
				}
			}
			if (Plugin.vocalLevel.Value >= VocalLevels.High)
			{
				PlayAudioWithVariant("ReportComplete", Random.Range(2, 4));
			}
			HUDManager.Instance.DisplayTip(header, "<size=15>" + body + "</size>", false, false, "LC_Tip1");
		}

		internal static IEnumerator GetScrapLeft(float delay = 5f)
		{
			int scrapLeft = 0;
			int scrapInShip = 0;
			int creditsLeft = 0;
			int creditsInShip = 0;
			yield return (object)new WaitForSeconds(delay);
			string header = "SCRAP SCAN RESULTS:";
			GrabbableObject[] items = Object.FindObjectsOfType<GrabbableObject>();
			GrabbableObject[] array = items;
			foreach (GrabbableObject item in array)
			{
				if (item.itemProperties.isScrap && !item.isHeld)
				{
					if (!item.isInShipRoom)
					{
						scrapLeft++;
						creditsLeft += item.scrapValue;
					}
					else
					{
						scrapInShip++;
						creditsInShip += item.scrapValue;
					}
				}
			}
			string scrapOutsideStr = ((scrapLeft == 0) ? "There are no items outside the ship." : ((scrapLeft <= 1) ? ("There is 1 item left, worth " + creditsChar + creditsLeft) : ("There are " + scrapLeft + " items left, worth " + creditsChar + creditsLeft)));
			string scrapInShipStr = ((scrapInShip == 0) ? "There are no items inside the ship." : ((scrapInShip <= 1) ? ("The ship currently has 1 item, worth " + creditsChar + creditsInShip) : ("The ship currently has " + scrapInShip + " items, worth " + creditsChar + creditsInShip)));
			if (Plugin.vocalLevel.Value >= VocalLevels.High)
			{
			}
			HUDManager.Instance.DisplayTip(header, "<size=15>" + scrapOutsideStr + "\n" + scrapInShipStr + "</size>", false, false, "LC_Tip1");
		}

		internal static void InitializeScannerVariables()
		{
			performAdvancedScan = Plugin.enableAdvancedScannerAuto.Value;
			enemiesTopText = "Entities:\n";
			itemsTopText = "Items:\n";
			scannerRange = 29f;
		}

		public static void Initialize()
		{
			Plugin.LogToConsole("Initializing VEGA");
			shouldBeInterrupted = false;
			signals = Plugin.messages.Value.Split(", ");
			InitializeScannerVariables();
			listening = false;
			if (!Plugin.useManualListening.Value || (Plugin.enableManualListeningAuto.Value && Plugin.useManualListening.Value))
			{
				listening = true;
			}
			Plugin.LogToConsole("Is VEGA listening -> " + listening, "debug");
			Plugin.LogToConsole("Registering voice commands");
			RegisterMiscCommands();
			RegisterMoonsInfo();
			RegisterBestiaryEntries();
			RegisterEntityInfo();
			RegisterDoorCommands();
			RegisterHazardsCommands();
			RegisterTeleportCommands();
			RegisterAdvancedScannerCommands();
			RegisterTimeOfDayCommands();
			RegisterRadarBoosterCommands();
			RegisterSignalTranslatorCommands();
			RegisterWeatherCommands();
			RegisterReportCommands();
			RegisterActivationCommands();
		}

		internal static void RegisterActivationCommands()
		{
			if (!Plugin.registerActivation.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[1] { "VEGA, activate" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, activate") && recognized.Confidence >= Plugin.confidence.Value && Plugin.useManualListening.Value && !StartOfRound.Instance.localPlayerController.isPlayerDead && !listening)
				{
					listening = true;
					Plugin.LogToConsole("Is VEGA listening -> " + listening, "debug");
					PlayAudio("Activate");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, deactivate" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, deactivate") && recognized.Confidence >= Plugin.confidence.Value && Plugin.useManualListening.Value && !StartOfRound.Instance.localPlayerController.isPlayerDead && listening)
				{
					listening = false;
					Plugin.LogToConsole("Is VEGA listening -> " + listening, "debug");
					PlayAudio("Deactivate");
				}
			});
		}

		internal static void RegisterMiscCommands()
		{
			if (Plugin.registerStop.Value)
			{
				Voice.RegisterPhrases(new string[3] { "VEGA, shut up", "VEGA, stop", "VEGA, stop talking" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, shut up") || !(recognized.Message != "VEGA, stop") || !(recognized.Message != "VEGA, stop talking")) && recognized.Confidence >= Plugin.confidence.Value)
					{
						audioSource.Stop();
					}
				});
			}
			if (Plugin.registerThanks.Value)
			{
				Voice.RegisterPhrases(new string[4] { "VEGA, thank you", "VEGA, thanks", "Thank you, VEGA", "Thanks, VEGA" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, thank you") || !(recognized.Message != "VEGA, thanks") || !(recognized.Message != "Thank you, VEGA") || !(recognized.Message != "Thanks, VEGA")) && recognized.Confidence >= Plugin.confidence.Value && listening)
					{
						PlayAudioWithVariant("NoProblem", Random.Range(1, 5));
					}
				});
			}
			if (!Plugin.registerInteractShipLights.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[2] { "VEGA, lights on", "VEGA, turn the lights on" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, lights on") || !(recognized.Message != "VEGA, turn the lights on")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
				{
					CoroutineManager.StartCoroutine(SwitchLights(on: true));
				}
			});
			Voice.RegisterPhrases(new string[3] { "VEGA, lights out", "VEGA, lights off", "VEGA, turn the lights off" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, lights out") || !(recognized.Message != "VEGA, lights off") || !(recognized.Message != "VEGA, turn the lights off")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
				{
					CoroutineManager.StartCoroutine(SwitchLights(on: false));
				}
			});
		}

		internal static void RegisterWeatherCommands()
		{
			if (!Plugin.registerWeatherInfo.Value)
			{
				return;
			}
			string[] array = weathers;
			foreach (string condition in array)
			{
				Voice.RegisterPhrases(new string[1] { "VEGA, info about " + condition + " weather" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if (!(recognized.Message != "VEGA, info about " + condition + " weather") && recognized.Confidence >= Plugin.confidence.Value && listening)
					{
						PlayAudioWithVariant(condition, 2);
					}
				});
			}
		}

		internal static void RegisterAdvancedScannerCommands()
		{
			if (!Plugin.registerAdvancedScanner.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[7] { "VEGA, activate scanner", "VEGA, activate advanced scanner", "VEGA, turn on scanner", "VEGA, turn on advanced scanner", "VEGA, scan", "VEGA, enable scanner", "VEGA, enable advanced scanner" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, activate scanner") || !(recognized.Message != "VEGA, activate advanced scanner") || !(recognized.Message != "VEGA, turn on scanner") || !(recognized.Message != "VEGA, turn on advanced scanner") || !(recognized.Message != "VEGA, scan") || !(recognized.Message != "VEGA, enable scanner") || !(recognized.Message != "VEGA, enable advanced scanner")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (performAdvancedScan)
					{
						PlayAudio("ScannerAlreadyActive");
					}
					else
					{
						Plugin.LogToConsole("Activating advanced scanner");
						performAdvancedScan = true;
						((TMP_Text)HUDManagerPatch.enemies.GetComponent<TextMeshProUGUI>()).SetText("Enemies:", true);
						((TMP_Text)HUDManagerPatch.items.GetComponent<TextMeshProUGUI>()).SetText("Items:", true);
						if (Plugin.vocalLevel.Value >= VocalLevels.Low)
						{
							PlayAudioWithVariant("AdvancedScannerEnabled", Random.Range(1, 4));
						}
					}
				}
			});
			Voice.RegisterPhrases(new string[5] { "VEGA, disable scanner", "VEGA, disable advanced scanner", "VEGA, turn off scanner", "VEGA, turn off advanced scanner", "VEGA, disable scan" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, disable scanner") || !(recognized.Message != "VEGA, disable advanced scanner") || !(recognized.Message != "VEGA, turn off scanner") || !(recognized.Message != "VEGA, turn off advanced scanner") || !(recognized.Message != "VEGA, disable scan")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (!performAdvancedScan)
					{
						PlayAudio("ScannerAlreadyInactive");
					}
					else
					{
						Plugin.LogToConsole("Deactivating advanced scanner");
						performAdvancedScan = false;
						((TMP_Text)HUDManagerPatch.enemies.GetComponent<TextMeshProUGUI>()).SetText("", true);
						((TMP_Text)HUDManagerPatch.items.GetComponent<TextMeshProUGUI>()).SetText("", true);
						if (Plugin.vocalLevel.Value >= VocalLevels.Low)
						{
							PlayAudioWithVariant("AdvancedScannerDisabled", Random.Range(1, 4));
						}
					}
				}
			});
		}

		internal static void RegisterTimeOfDayCommands()
		{
			if (!Plugin.registerTime.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[6] { "VEGA, what's the current time of day?", "VEGA, current time of day", "VEGA, time of day", "VEGA, current time", "VEGA, time", "VEGA, what time is it?" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, what's the current time of day?") || !(recognized.Message != "VEGA, current time of day") || !(recognized.Message != "VEGA, time of day") || !(recognized.Message != "VEGA, current time") || !(recognized.Message != "VEGA, time") || !(recognized.Message != "VEGA, what time is it?")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					GetDayMode();
				}
			});
		}

		internal static void RegisterReportCommands()
		{
			if (Plugin.registerCrewStatus.Value)
			{
				Voice.RegisterPhrases(new string[6] { "VEGA, crew status", "VEGA, team status", "VEGA, crew info", "VEGA, team info", "VEGA, crew report", "VEGA, team report" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, crew status") || !(recognized.Message != "VEGA, team status") || !(recognized.Message != "VEGA, crew info") || !(recognized.Message != "VEGA, team info") || !(recognized.Message != "VEGA, crew report") || !(recognized.Message != "VEGA, team report")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						CoroutineManager.StartCoroutine(GetCrewStatus());
					}
				});
			}
			if (Plugin.registerCrewInShip.Value)
			{
				Voice.RegisterPhrases(new string[7] { "VEGA, crew in ship", "VEGA, people in ship", "VEGA, get crew in ship", "VEGA, get people in ship", "VEGA, how many people are in the ship?", "VEGA, is anyone in the ship?", "VEGA, is anybody in the ship?" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, crew in ship") || !(recognized.Message != "VEGA, people in ship") || !(recognized.Message != "VEGA, get crew in ship") || !(recognized.Message != "VEGA, get people in ship") || !(recognized.Message != "VEGA, how many people are in the ship?") || !(recognized.Message != "VEGA, is anyone in the ship?") || !(recognized.Message != "VEGA, is anybody in the ship?")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						CoroutineManager.StartCoroutine(GetCrewInShip());
					}
				});
			}
			if (!Plugin.registerScrapLeft.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[4] { "VEGA, scrap left", "VEGA, items left", "VEGA, scan for scrap", "VEGA, scan for items" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, scrap left") || !(recognized.Message != "VEGA, items left") || !(recognized.Message != "VEGA, scan for scrap") || !(recognized.Message != "VEGA, scan for items")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
				{
					CoroutineManager.StartCoroutine(GetScrapLeft());
				}
			});
		}

		internal static void RegisterTeleportCommands()
		{
			if (Plugin.registerTeleporter.Value)
			{
				Voice.RegisterPhrases(new string[4] { "VEGA, tp", "VEGA, activate tp", "VEGA, teleport", "VEGA, activate teleporter" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, tp") || !(recognized.Message != "VEGA, activate tp") || !(recognized.Message != "VEGA, teleport") || !(recognized.Message != "VEGA, activate teleporter")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						ActivateTeleporter();
					}
				});
			}
			if (!Plugin.registerRadarSwitch.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[5] { "VEGA, switch to me", "VEGA, switch radar", "VEGA, switch radar to me", "VEGA, focus", "VEGA, focus on me" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, switch to me") || !(recognized.Message != "VEGA, switch radar") || !(recognized.Message != "VEGA, switch radar to me") || !(recognized.Message != "VEGA, focus") || !(recognized.Message != "VEGA, focus on me")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (!StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						if ((Object)(object)StartOfRound.Instance.mapScreen.targetedPlayer == (Object)(object)StartOfRound.Instance.localPlayerController)
						{
							PlayAudio("RadarAlreadyFocused");
							return;
						}
						int num = StartOfRound.Instance.mapScreen.radarTargets.FindIndex((TransformAndName target) => (Object)(object)target.transform == (Object)(object)((Component)StartOfRound.Instance.localPlayerController).transform);
						StartOfRound.Instance.mapScreen.SwitchRadarTargetAndSync(num);
					}
					PlayAudioWithVariant("RadarSwitch", Random.Range(1, 4));
				}
			});
		}

		internal static void RegisterDoorCommands()
		{
			if (Plugin.registerInteractSecureDoor.Value)
			{
				Voice.RegisterPhrases(new string[4] { "VEGA, open secure door", "VEGA, open door", "VEGA, open the door", "VEGA, open the secure door" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, open secure door") || !(recognized.Message != "VEGA, open door") || !(recognized.Message != "VEGA, open the door") || !(recognized.Message != "VEGA, open the secure door")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						OpenSecureDoor();
					}
				});
				Voice.RegisterPhrases(new string[4] { "VEGA, close secure door", "VEGA, close door", "VEGA, close the door", "VEGA, close the secure door" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, close secure door") || !(recognized.Message != "VEGA, close door") || !(recognized.Message != "VEGA, close the door") || !(recognized.Message != "VEGA, close the secure door")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						CloseSecureDoor();
					}
				});
			}
			if (Plugin.registerInteractAllSecureDoors.Value)
			{
				Voice.RegisterPhrases(new string[2] { "VEGA, open all secure doors", "VEGA, open all doors" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, open all secure doors") || !(recognized.Message != "VEGA, open all doors")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						OpenAllDoors();
					}
				});
				Voice.RegisterPhrases(new string[2] { "VEGA, close all secure doors", "VEGA, close all doors" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, close all secure doors") || !(recognized.Message != "VEGA, close all doors")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						CloseAllDoors();
					}
				});
			}
			if (!Plugin.registerInteractShipDoors.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[3] { "VEGA, open ship doors", "VEGA, open the ship's doors", "VEGA, open hangar doors" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				if ((!(recognized.Message != "VEGA, open ship doors") || !(recognized.Message != "VEGA, open the ship's doors") || !(recognized.Message != "VEGA, open hangar doors")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
				{
					HangarShipDoor val2 = Object.FindObjectOfType<HangarShipDoor>();
					if ((Object)(object)val2 != (Object)null)
					{
						InteractTrigger component2 = ((Component)((Component)val2).transform.Find("HangarDoorButtonPanel/StartButton/Cube (2)")).GetComponent<InteractTrigger>();
						component2.Interact(((Component)StartOfRound.Instance.localPlayerController).transform);
						if (!val2.shipDoorsAnimator.GetBool("Closed") && Plugin.vocalLevel.Value >= VocalLevels.Low)
						{
							PlayAudio("ShipDoorsOpened", 0.7f);
						}
					}
				}
			});
			Voice.RegisterPhrases(new string[3] { "VEGA, close ship doors", "VEGA, close the ship's doors", "VEGA, close hangar doors" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				if ((!(recognized.Message != "VEGA, close ship doors") || !(recognized.Message != "VEGA, close the ship's doors") || !(recognized.Message != "VEGA, close hangar doors")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
				{
					HangarShipDoor val = Object.FindObjectOfType<HangarShipDoor>();
					if ((Object)(object)val != (Object)null)
					{
						InteractTrigger component = ((Component)((Component)val).transform.Find("HangarDoorButtonPanel/StopButton/Cube (3)")).GetComponent<InteractTrigger>();
						component.Interact(((Component)StartOfRound.Instance.localPlayerController).transform);
						if (val.shipDoorsAnimator.GetBool("Closed") && Plugin.vocalLevel.Value >= VocalLevels.Low)
						{
							PlayAudio("ShipDoorsClosed", 0.7f);
						}
					}
				}
			});
		}

		internal static void RegisterSignalTranslatorCommands()
		{
			if (!Plugin.registerSignalTranslator.Value)
			{
				return;
			}
			string[] array = signals;
			foreach (string signal in array)
			{
				Voice.RegisterPhrases(new string[2]
				{
					"VEGA, transmit " + signal,
					"VEGA, send " + signal
				});
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, transmit " + signal) || !(recognized.Message != "VEGA, send " + signal)) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						SignalTranslator val = Object.FindObjectOfType<SignalTranslator>();
						if ((Object)(object)val == (Object)null)
						{
							PlayAudio("NoSignalTranslator");
						}
						else
						{
							HUDManager.Instance.UseSignalTranslatorServerRpc(signal);
						}
					}
				});
			}
		}

		internal static void RegisterRadarBoosterCommands()
		{
			if (!Plugin.registerRadarBoosters.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[1] { "VEGA, ping" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, ping") && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
				{
					InteractWithBooster(ping: true);
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, flash" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, flash") && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
				{
					InteractWithBooster(ping: false);
				}
			});
		}

		internal static void RegisterHazardsCommands()
		{
			if (Plugin.registerDisableTurret.Value)
			{
				Voice.RegisterPhrases(new string[2] { "VEGA, disable the turret", "VEGA, disable turret" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, disable the turret") || !(recognized.Message != "VEGA, disable turret")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						turretDisabled = false;
						noVisibleTurret = false;
						noTurretNearby = false;
						noTurrets = false;
						noToils = false;
						if (ModChecker.hasToilHead)
						{
							DisableToil();
						}
						if (!toilDisabled || !ModChecker.hasToilHead)
						{
							DisableTurret();
						}
						PlayTurretAudio();
					}
				});
			}
			if (Plugin.registerDisableAllTurrets.Value)
			{
				Voice.RegisterPhrases(new string[1] { "VEGA, disable all turrets" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if (!(recognized.Message != "VEGA, disable all turrets") && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						turretsExist = false;
						if (ModChecker.hasToilHead)
						{
							DisableAllToils();
						}
						DisableAllTurrets();
					}
				});
			}
			if (Plugin.registerDisableMine.Value)
			{
				Voice.RegisterPhrases(new string[4] { "VEGA, disable the mine", "VEGA, disable mine", "VEGA, disable the landmine", "VEGA, disable landmine" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, disable the mine") || !(recognized.Message != "VEGA, disable mine") || !(recognized.Message != "VEGA, disable the landmine") || !(recognized.Message != "VEGA, disable landmine")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						DisableMine();
					}
				});
			}
			if (Plugin.registerDisableAllMines.Value)
			{
				Voice.RegisterPhrases(new string[2] { "VEGA, disable all mines", "VEGA, disable all landmines" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, disable all mines") || !(recognized.Message != "VEGA, disable all landmines")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						DisableAllMines();
					}
				});
			}
			if (Plugin.registerDisableSpikeTrap.Value)
			{
				Voice.RegisterPhrases(new string[4] { "VEGA, disable the trap", "VEGA, disable trap", "VEGA, disable the spike trap", "VEGA, disable spike trap" });
				Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
				{
					if ((!(recognized.Message != "VEGA, disable the trap") || !(recognized.Message != "VEGA, disable trap") || !(recognized.Message != "VEGA, disable the spike trap") || !(recognized.Message != "VEGA, disable spike trap")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
					{
						DisableSpikeTrap();
					}
				});
			}
			if (!Plugin.registerDisableAllSpikeTraps.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[2] { "VEGA, disable all traps", "VEGA, disable all spike traps" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, disable all traps") || !(recognized.Message != "VEGA, disable all spike traps")) && recognized.Confidence >= Plugin.confidence.Value && listening && !StartOfRound.Instance.localPlayerController.isPlayerDead)
				{
					DisableAllSpikeTraps();
				}
			});
		}

		internal static void RegisterMoonsInfo()
		{
			if (!Plugin.registerMoonsInfo.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[1] { "VEGA, info about experimentation" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about experimentation") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("41-EXP");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about assurance" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about assurance") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("220-ASS");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about vow" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about vow") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("56-VOW");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about offense" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about offense") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("21-OFF");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about march" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about march") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("61-MAR");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about adamance" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about adamance") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("20-ADA");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about rend" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about rend") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("85-REN");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about dine" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about dine") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("7-DIN");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about titan" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about titan") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("8-TIT");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about artifice" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about artifice") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("68-ART");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about embrion" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about embrion") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("5-EMB");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about liquidation" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about liquidation") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("44-LIQ");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about mars" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about mars") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("4-MARS");
				}
			});
			Voice.RegisterPhrases(new string[3] { "VEGA, info about the Company", "VEGA, info about the Company building", "VEGA, info about Gordion" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, info about the Company") || !(recognized.Message != "VEGA, info about the Company building") || !(recognized.Message != "VEGA, info about Gordion")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					PlayAudio("71-GOR");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Asteroid 13" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Asteroid 13") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("57 Asteroid-13"))
				{
					PlayAudio("57-AST-13");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Atlantica" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Atlantica") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("44 Atlantica"))
				{
					PlayAudio("44-ATL");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Cosmocos" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Cosmocos") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("42 Cosmocos"))
				{
					PlayAudio("42-COS");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Desolation" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Desolation") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("48 Desolation"))
				{
					PlayAudio("48-DES");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Etern" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Etern") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("154 Etern"))
				{
					PlayAudio("154-ETE");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Fission C" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Fission C") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("25 Fission-C"))
				{
					PlayAudio("25-FIS-C");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Gloom" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Gloom") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("36 Gloom"))
				{
					PlayAudio("36-GLO");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Gratar" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Gratar") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("147 Gratar"))
				{
					PlayAudio("147-GRA");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Infernis" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Infernis") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("46 Infernis"))
				{
					PlayAudio("46-INF");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Junic" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Junic") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("84 Junic"))
				{
					PlayAudio("84-JUN");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Oldred" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Oldred") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("134 Oldred"))
				{
					PlayAudio("134-OLD");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Polarus" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Polarus") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("94 Polarus"))
				{
					PlayAudio("94-POL");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Acidir" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Acidir") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("76 Acidir"))
				{
					PlayAudio("76-ACI");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Affliction" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Affliction") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("59 Affliction"))
				{
					PlayAudio("59-AFF");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Eve M" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Eve M") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("127 Eve-M"))
				{
					PlayAudio("127-EVE-M");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Sector 0" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Sector 0") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("71 Sector-0"))
				{
					PlayAudio("71-SEC-0");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Summit" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Summit") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("290 Summit"))
				{
					PlayAudio("290-SUM");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Penumbra" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Penumbra") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("813 Penumbra"))
				{
					PlayAudio("813-PEN");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Argent" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Argent") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("32 Argent"))
				{
					PlayAudio("32-ARG");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Azure" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Azure") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("39 Azure"))
				{
					PlayAudio("39-AZU");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Budapest" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Budapest") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("618 Budapest"))
				{
					PlayAudio("618-BUD");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Celestria" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Celestria") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("9 Celestria"))
				{
					PlayAudio("9-CEL");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Crystallum" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Crystallum") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("Crystallum"))
				{
					PlayAudio("???-CRY");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Echelon" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Echelon") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("30 Echelon"))
				{
					PlayAudio("30-ECH");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Harloth" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Harloth") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("93 Harloth"))
				{
					PlayAudio("93-HAR");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Maritopia" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Maritopia") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("153 Maritopia"))
				{
					PlayAudio("153-MAR");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Nimbus" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Nimbus") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("Nimbus"))
				{
					PlayAudio("???-NIM");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Nyx" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Nyx") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("34 Nyx"))
				{
					PlayAudio("34-NYX");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Psych Sanctum" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Psych Sanctum") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("111 PsychSanctum"))
				{
					PlayAudio("111-PSY");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Spectralis" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Spectralis") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("Spectralis"))
				{
					PlayAudio("???-SPE");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Zenit" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Zenit") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("37 Zenit"))
				{
					PlayAudio("37-ZEN");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Calt Prime" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Calt Prime") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("35 CaltPrime"))
				{
					PlayAudio("35-CAL");
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, info about Sanguine" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, info about Sanguine") && recognized.Confidence >= Plugin.confidence.Value && listening && ClientHasMoon("Sanguine"))
				{
					PlayAudio("???-SAN");
				}
			});
		}

		internal static void RegisterBestiaryEntries()
		{
			if (!Plugin.registerBestiaryEntries.Value)
			{
				return;
			}
			Voice.RegisterPhrases(new string[3] { "VEGA, read Hawk entry", "VEGA, read Baboon entry", "VEGA, read Baboon hawk entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, read Hawk entry") || !(recognized.Message != "VEGA, read Baboon entry") || !(recognized.Message != "VEGA, read Baboon hawk entry")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (TerminalPatch.scannedEnemyIDs.Contains(16))
					{
						PlayAudio("BaboonHawk");
					}
					else
					{
						PlayAudioWithVariant("NoEntityData", Random.Range(1, 5));
					}
				}
			});
			Voice.RegisterPhrases(new string[2] { "VEGA, read Bunker spider entry", "VEGA, read Spider entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, read Bunker spider entry") || !(recognized.Message != "VEGA, read Spider entry")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (TerminalPatch.scannedEnemyIDs.Contains(12))
					{
						PlayAudio("BunkerSpider");
					}
					else
					{
						PlayAudioWithVariant("NoEntityData", Random.Range(1, 5));
					}
				}
			});
			Voice.RegisterPhrases(new string[3] { "VEGA, read Hoarding bug entry", "VEGA, read Loot bug entry", "VEGA, read Yippee bug entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, read Hoarding bug entry") || !(recognized.Message != "VEGA, read Loot bug entry") || !(recognized.Message != "VEGA, read Yippee bug entry")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (TerminalPatch.scannedEnemyIDs.Contains(4))
					{
						PlayAudio("YippeeBug");
					}
					else
					{
						PlayAudioWithVariant("NoEntityData", Random.Range(1, 5));
					}
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, read Bracken entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, read Bracken entry") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (TerminalPatch.scannedEnemyIDs.Contains(1))
					{
						PlayAudio("Bracken");
					}
					else
					{
						PlayAudioWithVariant("NoEntityData", Random.Range(1, 5));
					}
				}
			});
			Voice.RegisterPhrases(new string[1] { "VEGA, read Butler entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if (!(recognized.Message != "VEGA, read Butler entry") && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (TerminalPatch.scannedEnemyIDs.Contains(19))
					{
						PlayAudio("Butler");
					}
					else
					{
						PlayAudioWithVariant("NoEntityData", Random.Range(1, 5));
					}
				}
			});
			Voice.RegisterPhrases(new string[2] { "VEGA, read Coil head entry", "VEGA, read Coil entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, read Coil head entry") || !(recognized.Message != "VEGA, read Coil entry")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (TerminalPatch.scannedEnemyIDs.Contains(7))
					{
						PlayAudio("Coil-Head");
					}
					else
					{
						PlayAudioWithVariant("NoEntityData", Random.Range(1, 5));
					}
				}
			});
			Voice.RegisterPhrases(new string[3] { "VEGA, read Forest Keeper entry", "VEGA, read Giant entry", "VEGA, read Keeper entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, read Forest Keeper entry") || !(recognized.Message != "VEGA, read Giant entry") || !(recognized.Message != "VEGA, read Keeper entry")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (TerminalPatch.scannedEnemyIDs.Contains(6))
					{
						PlayAudio("ForestKeeper");
					}
					else
					{
						PlayAudioWithVariant("NoEntityData", Random.Range(1, 5));
					}
				}
			});
			Voice.RegisterPhrases(new string[2] { "VEGA, read Eyeless dog entry", "VEGA, read dog entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, read Eyeless dog entry") || !(recognized.Message != "VEGA, read dog entry")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (TerminalPatch.scannedEnemyIDs.Contains(3))
					{
						PlayAudio("EyelessDog");
					}
					else
					{
						PlayAudioWithVariant("NoEntityData", Random.Range(1, 5));
					}
				}
			});
			Voice.RegisterPhrases(new string[3] { "VEGA, read Earth Leviathan entry", "VEGA, read Leviathan entry", "VEGA, read Worm entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Message != "VEGA, read Earth Leviathan entry") || !(recognized.Message != "VEGA, read Leviathan entry") || !(recognized.Message != "VEGA, read Worm entry")) && recognized.Confidence >= Plugin.confidence.Value && listening)
				{
					if (TerminalPatch.scannedEnemyIDs.Contains(9))
					{
						PlayAudio("Sandworm");
					}
					else
					{
						PlayAudioWithVariant("NoEntityData", Random.Range(1, 5));
					}
				}
			});
			Voice.RegisterPhrases(new string[2] { "VEGA, read Jester entry", "VEGA, read Jack in the box entry" });
			Voice.RegisterCustomHandler((EventHandler<VoiceRecognitionEventArgs>)delegate(object obj, VoiceRecognitionEventArgs recognized)
			{
				if ((!(recognized.Mess