Decompiled source of VoidDrones v0.48.6

plugins/VoidDrones.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CG;
using CG.Client.Audio;
using CG.Client.Player.HUD;
using CG.Client.Player.Interactions;
using CG.Client.Ship.Hull;
using CG.Client.Ship.Interactions;
using CG.Client.UserData;
using CG.Game;
using CG.Game.Missions;
using CG.Game.Player;
using CG.Game.Scenarios;
using CG.Game.Scenarios.Actions;
using CG.Game.SpaceObjects;
using CG.Game.SpaceObjects.Controllers;
using CG.Game.SpaceObjects.Controllers.ImpulseJumping;
using CG.Graphics;
using CG.Network;
using CG.Objects;
using CG.Ship;
using CG.Ship.Hull;
using CG.Ship.Modules;
using CG.Ship.Modules.AutoMechanic;
using CG.Ship.Modules.Weapons;
using CG.Ship.Object;
using CG.Ship.Repair;
using CG.Ship.Scanning;
using CG.Ship.Shield;
using CG.Ship.Status;
using CG.Ship.TargetLocking;
using CG.Space;
using CG.Space.Projectiles;
using CG.Space.SpaceObjects;
using CG.Space.SpaceObjects.Weapons;
using CG.SpaceObjects;
using CG.Utils;
using Cinemachine;
using Client.Player.Interactions;
using Client.Ship.Actor;
using Client.Utils;
using Code.Gameplay;
using ExitGames.Client.Photon;
using FMOD;
using FMOD.Studio;
using FMODUnity;
using Gameplay.Carryables;
using Gameplay.CompositeWeapons;
using Gameplay.CompositeWeapons.Effects;
using Gameplay.Damage;
using Gameplay.DataTables;
using Gameplay.Loot;
using Gameplay.NPC;
using Gameplay.NPC.AI;
using Gameplay.Perks;
using Gameplay.Quests;
using Gameplay.Ship;
using Gameplay.Ship.VoidJump;
using Gameplay.SpacePlatforms;
using Gameplay.Utilities;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Opsive.Shared.Input;
using Photon.Pun;
using Photon.Realtime;
using ResourceAssets;
using RuntimeAssets;
using TMPro;
using UI.Core;
using UI.Fabricator;
using UI.LoadoutTerminal;
using UI.ObjectMarker;
using UI.Ping;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.VFX;
using VC.Common.CoreData;
using VC.Common.PlayerShip;
using VFX;
using VoidDrones.Content;
using VoidDrones.Patches;
using VoidManager;
using VoidManager.Chat.Router;
using VoidManager.CustomGUI;
using VoidManager.MPModChecks;
using VoidManager.ModMessages;
using VoidManager.Utilities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("NeoLorem")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Fly combat drones from a gunner seat, and let the Void Hive Mind fly the ship (Void Crew).")]
[assembly: AssemblyFileVersion("0.48.6.0")]
[assembly: AssemblyInformationalVersion("0.48.6")]
[assembly: AssemblyProduct("VoidDrones")]
[assembly: AssemblyTitle("VoidDrones")]
[assembly: AssemblyVersion("0.48.6.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace VoidDrones
{
	public class DronesCommand : ChatCommand
	{
		public override string[] CommandAliases()
		{
			return new string[1] { "drones" };
		}

		public override string Description()
		{
			return "Void Drones debug info: ship, nearby, modules, weapons, enemies, fx [N]; unlock [on|off] (unlock all items for testing); loot; parktest [N] [structure] | stop (host: N scored EVA parkings)";
		}

		public override string[] UsageExamples()
		{
			return new string[15]
			{
				"/drones ship", "/drones nearby", "/drones modules", "/drones weapons", "/drones enemies", "/drones fx", "/drones fx 3", "/drones find beamcaster", "/drones model drone", "/drones unlock",
				"/drones unlock off", "/drones loot", "/drones parktest", "/drones parktest 20 structure", "/drones parktest stop"
			};
		}

		public override void Execute(string arguments)
		{
			string text = (arguments ?? string.Empty).Trim().ToLowerInvariant();
			if (text == "fx" || text.StartsWith("fx "))
			{
				DroneEffects(text.Substring(2).Trim());
				return;
			}
			if (text.StartsWith("find "))
			{
				Plugin.Log.LogInfo((object)FindAssets(text.Substring(5).Trim()));
				Messaging.Echo("/drones " + text + ": results in the BepInEx log", true);
				return;
			}
			if (text.StartsWith("model "))
			{
				Plugin.Log.LogInfo((object)DescribeModel(text.Substring(6).Trim()));
				Messaging.Echo("/drones " + text + ": model tree in the BepInEx log", true);
				return;
			}
			switch (text)
			{
			case "recon":
			{
				if (!PhotonNetwork.IsMasterClient)
				{
					Messaging.Echo("/drones recon: host only", true);
					break;
				}
				ClientGame current2 = ClientGame.Current;
				PlayerControlledShip val = ((current2 != null) ? current2.PlayerShip : null);
				Messaging.Echo("/drones recon: " + ReconSweep.StartSweep(val, ((Object)(object)val != (Object)null && ((OrbitObject)val).Sector != (GameSessionSector)null) ? ((OrbitObject)val).Sector.Id : (-1)), true);
				break;
			}
			case "carrier":
			{
				if (!PhotonNetwork.IsMasterClient)
				{
					Messaging.Echo("/drones carrier: host only", true);
					break;
				}
				ClientGame current = ClientGame.Current;
				Messaging.Echo("/drones carrier: " + HollowCarrierEvent.Spawn((current != null) ? current.PlayerShip : null), true);
				break;
			}
			default:
				if (!text.StartsWith("unlock "))
				{
					if (text == "parktest" || text.StartsWith("parktest "))
					{
						Messaging.Echo("/drones parktest: " + ParkTest.Command(text.Substring(8).Trim()), true);
						break;
					}
					if (text == "loot")
					{
						Plugin.Log.LogInfo((object)DroneLoot.Coverage());
						Messaging.Echo("/drones loot: where each Void Drones item drops, in the BepInEx log", true);
						break;
					}
					if (text == "icon" || text.StartsWith("icon "))
					{
						string text2 = text.Substring(4).Trim();
						DroneType type = ((text2 == "energy") ? DroneType.Energy : ((text2 == "support") ? DroneType.Support : DroneType.Kinetic));
						Messaging.Echo("/drones icon: " + IconRender.Start(type), true);
						break;
					}
					string text3;
					switch (text)
					{
					case "layout":
						Messaging.Echo("/drones layout: " + DroneKitbash.Reload() + " (" + DroneKitbash.LayoutPath + ")", true);
						return;
					case "ship":
						text3 = DescribePlayerShip();
						break;
					case "nearby":
						text3 = DescribeNearby();
						break;
					case "modules":
						text3 = DescribeModuleContainer();
						break;
					case "weapons":
						text3 = DescribeWeapons();
						break;
					case "enemies":
						text3 = DescribeShipPrefabs();
						break;
					default:
						Messaging.Echo("Usage: /drones ship | nearby | modules | weapons | enemies | fx [N] | find <text> | model <drone|bay|guid> | layout | icon [kinetic|energy|support] | recon | carrier | unlock [on|off] | loot | parktest [N] [structure] | parktest stop", true);
						return;
					}
					Plugin.Log.LogInfo((object)text3);
					Messaging.Echo("/drones " + text + ": written to BepInEx log", true);
					break;
				}
				goto case "unlock";
			case "unlock":
				Messaging.Echo("/drones unlock: " + DroneUnlocks.Command(text.Substring(6).Trim()), true);
				break;
			}
		}

		private static string FindAssets(string text)
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			StringBuilder stringBuilder = new StringBuilder("Find \"" + text + "\":\n");
			foreach (CloneStarObjectDef def in ((ResourceAssetContainer<CloneStarObjectContainer, AbstractCloneStarObject, CloneStarObjectDef>)(object)ResourceAssetContainer<CloneStarObjectContainer, AbstractCloneStarObject, CloneStarObjectDef>.Instance).AssetDescriptions)
			{
				string text2 = SafeHeader(delegate
				{
					IResourceAssetContextInfo contextInfo = def.ContextInfo;
					return (contextInfo == null) ? null : contextInfo.HeaderText;
				});
				if (Matches(text2, text) || Matches(((ResourceAssetDef<AbstractCloneStarObject>)(object)def).Path, text))
				{
					stringBuilder.AppendLine($"  object \"{text2}\" path={((ResourceAssetDef<AbstractCloneStarObject>)(object)def).Path} guid={((ResourceAssetDef<AbstractCloneStarObject>)(object)def).AssetGuid}");
				}
			}
			foreach (CompositeWeaponDataDef def2 in ((ResourceAssetContainer<CompositeWeaponDataContainer, CompositeWeaponData, CompositeWeaponDataDef>)(object)ResourceAssetContainer<CompositeWeaponDataContainer, CompositeWeaponData, CompositeWeaponDataDef>.Instance).AssetDescriptions)
			{
				string text3 = SafeHeader(delegate
				{
					IResourceAssetContextInfo contextInfo = ((PurchasableResourceAssetDef<CompositeWeaponData>)(object)def2).ContextInfo;
					return (contextInfo == null) ? null : contextInfo.HeaderText;
				});
				if (Matches(text3, text) || Matches(((ResourceAssetDef<CompositeWeaponData>)(object)def2).Path, text))
				{
					CompositeWeapon val = ((ResourceAssetDef<CompositeWeaponData>)(object)def2).Asset?.Data;
					stringBuilder.AppendLine($"  turret \"{text3}\" path={((ResourceAssetDef<CompositeWeaponData>)(object)def2).Path} guid={((ResourceAssetDef<CompositeWeaponData>)(object)def2).AssetGuid} core={((ResourceAssetRef)(val?.CoreElement?)).AssetGuid} " + $"pivot={((ResourceAssetRef)(val?.PivotElement?)).AssetGuid} casing={((ResourceAssetRef)(val?.CasingElement?)).AssetGuid} scope={((ResourceAssetRef)(val?.ScopeElement?)).AssetGuid}");
				}
			}
			return stringBuilder.ToString();
		}

		private static bool Matches(string value, string text)
		{
			if (!string.IsNullOrEmpty(value))
			{
				return value.IndexOf(text, StringComparison.OrdinalIgnoreCase) >= 0;
			}
			return false;
		}

		private static string SafeHeader(Func<string> header)
		{
			try
			{
				return header() ?? string.Empty;
			}
			catch
			{
				return string.Empty;
			}
		}

		private static string DescribeModel(string target)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			if (DroneKitbash.TryParseGuid(target, out var guid) && DroneKitbash.TryGetRecipe(guid, out var recipe))
			{
				StringBuilder stringBuilder = new StringBuilder("Turret recipe " + target + " parts:\n");
				(string, ResourceAssetRef)[] array = new(string, ResourceAssetRef)[4]
				{
					("core", (ResourceAssetRef)(object)recipe.CoreElement),
					("pivot", (ResourceAssetRef)(object)recipe.PivotElement),
					("casing", (ResourceAssetRef)(object)recipe.CasingElement),
					("scope", (ResourceAssetRef)(object)recipe.ScopeElement)
				};
				for (int i = 0; i < array.Length; i++)
				{
					var (text, val) = array[i];
					if (!(val == (ResourceAssetRef)null) && !val.IsNull)
					{
						string text2 = ((object)Unsafe.As<GUIDUnion, GUIDUnion>(ref val.AssetGuid)/*cast due to .constrained prefix*/).ToString();
						stringBuilder.Append("--- " + text + " (source \"" + text2 + "\") ---\n");
						stringBuilder.Append(DescribeModel(text2));
					}
				}
				return stringBuilder.ToString();
			}
			GameObject val2 = DroneKitbash.ResolvePrefab(target);
			if ((Object)(object)val2 == (Object)null)
			{
				return "Model \"" + target + "\": not found (use drone, bay, or a 32-character GUID from /drones find)";
			}
			StringBuilder stringBuilder2 = new StringBuilder("Model " + ((Object)val2).name + " (paths are relative, ready for the layout file):\n");
			for (int j = 0; j < val2.transform.childCount; j++)
			{
				AppendTree(stringBuilder2, val2.transform.GetChild(j), 0, ((Object)val2.transform.GetChild(j)).name);
			}
			return stringBuilder2.ToString();
		}

		private static void AppendTree(StringBuilder sb, Transform node, int depth, string path)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(' ', 2 + depth * 2).Append(path);
			if (!((Component)node).gameObject.activeSelf)
			{
				stringBuilder.Append(" [inactive]");
			}
			stringBuilder.Append($" pos={node.localPosition} rot={node.localEulerAngles} scale={node.localScale}");
			MeshFilter component = ((Component)node).GetComponent<MeshFilter>();
			if ((Object)(object)component != (Object)null && (Object)(object)component.sharedMesh != (Object)null)
			{
				stringBuilder.Append($" mesh={((Object)component.sharedMesh).name} ({component.sharedMesh.vertexCount} verts)");
			}
			Renderer component2 = ((Component)node).GetComponent<Renderer>();
			if ((Object)(object)component2 != (Object)null)
			{
				List<string> list = new List<string>();
				Material[] sharedMaterials = component2.sharedMaterials;
				foreach (Material val in sharedMaterials)
				{
					list.Add(((Object)(object)val != (Object)null) ? ((Object)val).name : "none");
				}
				stringBuilder.Append(" " + ((object)component2).GetType().Name + "[" + string.Join(", ", list) + "]");
			}
			sb.AppendLine(stringBuilder.ToString());
			for (int j = 0; j < node.childCount; j++)
			{
				AppendTree(sb, node.GetChild(j), depth + 1, path + "/" + ((Object)node.GetChild(j)).name);
			}
		}

		private static void DroneEffects(string argument)
		{
			DroneController droneController = null;
			foreach (DroneController value in DroneController.ByBay.Values)
			{
				if ((Object)(object)value != (Object)null)
				{
					droneController = value;
					break;
				}
			}
			if ((Object)(object)droneController == (Object)null)
			{
				Messaging.Echo("/drones fx: launch a drone first", true);
				return;
			}
			Renderer[] componentsInChildren = ((Component)droneController).GetComponentsInChildren<Renderer>(true);
			if (int.TryParse(argument, out var result))
			{
				if (result < 0 || result >= componentsInChildren.Length)
				{
					Messaging.Echo($"/drones fx: pick 0-{componentsInChildren.Length - 1}", true);
					return;
				}
				Renderer val = componentsInChildren[result];
				val.enabled = !val.enabled;
				object[] obj = new object[4]
				{
					result,
					((Object)((Component)val).gameObject).name,
					((object)val).GetType().Name,
					null
				};
				Material sharedMaterial = val.sharedMaterial;
				obj[3] = ((sharedMaterial != null) ? ((Object)sharedMaterial).name : null);
				Messaging.Echo(string.Format("fx {0}: {1} ({2}, {3}) ", obj) + (val.enabled ? "ON" : "OFF"), true);
				return;
			}
			StringBuilder stringBuilder = new StringBuilder($"Drone renderers ({componentsInChildren.Length}):\n");
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				Renderer val2 = componentsInChildren[i];
				VisualEffect component = ((Component)val2).GetComponent<VisualEffect>();
				object[] obj2 = new object[4]
				{
					i,
					((Object)((Component)val2).gameObject).name,
					((object)val2).GetType().Name,
					null
				};
				Material sharedMaterial2 = val2.sharedMaterial;
				obj2[3] = ((sharedMaterial2 != null) ? ((Object)sharedMaterial2).name : null);
				string text = string.Format("  {0}: {1} {2} material={3} ", obj2);
				object obj3;
				if (component == null)
				{
					obj3 = null;
				}
				else
				{
					VisualEffectAsset visualEffectAsset = component.visualEffectAsset;
					obj3 = ((visualEffectAsset != null) ? ((Object)visualEffectAsset).name : null);
				}
				if (obj3 == null)
				{
					obj3 = "-";
				}
				stringBuilder.AppendLine(text + $"vfx={obj3} enabled={val2.enabled}");
			}
			Plugin.Log.LogInfo((object)stringBuilder.ToString());
			Messaging.Echo($"/drones fx: {componentsInChildren.Length} renderers listed in the log; '/drones fx N' toggles one", true);
		}

		private static string DescribePlayerShip()
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			ClientGame current = ClientGame.Current;
			PlayerControlledShip val = ((current != null) ? current.PlayerShip : null);
			if ((Object)(object)val == (Object)null)
			{
				return "No player ship";
			}
			StringBuilder stringBuilder = new StringBuilder();
			object[] obj = new object[4]
			{
				((Object)val).name,
				((OrbitObject)val).Faction,
				((AbstractCloneStarObject)val).ContainerGuid,
				null
			};
			Player owner = ((MonoBehaviourPun)val).photonView.Owner;
			obj[3] = ((owner != null) ? owner.NickName : null);
			stringBuilder.AppendLine(string.Format("Player ship {0} faction={1} guid={2} owner={3}", obj));
			foreach (CellModule allModule in val.GetAllModules())
			{
				stringBuilder.AppendLine($"  module {((Object)allModule).name} type={((object)allModule).GetType().Name} guid={((AbstractCloneStarObject)allModule).ContainerGuid}");
			}
			return stringBuilder.ToString();
		}

		private static string DescribeNearby()
		{
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			GameSessionSector activeSector = GameSessionManager.ActiveSector;
			if (activeSector == (GameSessionSector)null)
			{
				return "No active sector";
			}
			StringBuilder stringBuilder = new StringBuilder();
			Sector sectorAsset = activeSector.SectorAsset;
			stringBuilder.AppendLine($"Sector {((sectorAsset != null) ? ((Object)sectorAsset).name : null)}: {activeSector.OrbitObjects.Count} orbit objects");
			foreach (OrbitObject item in new List<OrbitObject>(activeSector.OrbitObjects))
			{
				SpaceCraft val = (SpaceCraft)(object)((item is SpaceCraft) ? item : null);
				if (val != null && (Object)(object)val != (Object)(object)ClientGame.Current.PlayerShip)
				{
					bool flag = (Object)(object)((Component)val).GetComponent<NpcAI>() != (Object)null;
					string text = $"  {((Object)val).name} type={((object)val).GetType().Name} faction={((OrbitObject)val).Faction} size={val.Size} ";
					object arg = ((AbstractCloneStarObject)val).ContainerGuid;
					object arg2 = flag;
					Player owner = ((MonoBehaviourPun)val).photonView.Owner;
					stringBuilder.AppendLine(text + $"guid={arg} npcAI={arg2} owner={((owner != null) ? owner.NickName : null)}");
				}
			}
			return stringBuilder.ToString();
		}

		private static string DescribeWeapons()
		{
			ClientGame current = ClientGame.Current;
			PlayerControlledShip val = ((current != null) ? current.PlayerShip : null);
			if ((Object)(object)val == (Object)null)
			{
				return "No player ship";
			}
			StringBuilder stringBuilder = new StringBuilder();
			foreach (CompositeWeaponModule module in val.GetModules<CompositeWeaponModule>())
			{
				bool flag = (Object)(object)((Component)module).GetComponent<DroneBayModule>() != (Object)null;
				stringBuilder.AppendLine(string.Format("  {0}{1} taken={2}: {3}", ((AbstractCloneStarObject)module).DisplayName, flag ? " [Drone Bay]" : "", module.IsTaken, DroneBayModule.DescribeStats(module)));
			}
			if (stringBuilder.Length <= 0)
			{
				return "No weapons on ship";
			}
			return "Ship weapons:\n" + stringBuilder;
		}

		private static string DescribeShipPrefabs()
		{
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			CloneStarObjectContainer instance = ResourceAssetContainer<CloneStarObjectContainer, AbstractCloneStarObject, CloneStarObjectDef>.Instance;
			string[] array = new string[6] { "Modules", "Carryable", "CompositeWeapons", "PlayerShip", "Cosmetic", "Hub" };
			StringBuilder stringBuilder = new StringBuilder();
			int num = 0;
			foreach (CloneStarObjectDef item in new List<CloneStarObjectDef>(((ResourceAssetContainer<CloneStarObjectContainer, AbstractCloneStarObject, CloneStarObjectDef>)(object)instance).AssetDescriptions))
			{
				string path = ((ResourceAssetDef<AbstractCloneStarObject>)(object)item).Path ?? string.Empty;
				if (!Array.Exists(array, (string s) => path.Contains(s)))
				{
					AbstractCloneStarObject asset = ((ResourceAssetDef<AbstractCloneStarObject>)(object)item).Asset;
					SpaceCraft val = (SpaceCraft)(object)((asset is SpaceCraft) ? asset : null);
					if (val != null && !(val is PlayerControlledShip))
					{
						bool flag = (Object)(object)((Component)val).GetComponent<NpcAI>() != (Object)null;
						stringBuilder.AppendLine($"  {((Object)val).name} type={((object)val).GetType().Name} faction={((OrbitObject)val).Faction} size={val.Size} npcAI={flag} guid={((ResourceAssetDef<AbstractCloneStarObject>)(object)item).AssetGuid} path={path}");
						num++;
					}
				}
			}
			return $"Spacecraft prefabs: {num}\n{stringBuilder}";
		}

		private static string DescribeModuleContainer()
		{
			//IL_0050: 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)
			ModuleContainer instance = ResourceAssetContainer<ModuleContainer, CellModule, ModuleDef>.Instance;
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendLine($"ModuleContainer: {((ResourceAssetContainer<ModuleContainer, CellModule, ModuleDef>)(object)instance).AssetDescriptions.Count} modules");
			foreach (ModuleDef assetDescription in ((ResourceAssetContainer<ModuleContainer, CellModule, ModuleDef>)(object)instance).AssetDescriptions)
			{
				stringBuilder.AppendLine($"  {((ResourceAssetDef<CellModule>)(object)assetDescription).Path} guid={((ResourceAssetDef<CellModule>)(object)assetDescription).AssetGuid} category={assetDescription.Category}");
			}
			return stringBuilder.ToString();
		}
	}
	internal static class MyPluginInfo
	{
		public const string GUID = "VoidDrones";

		public const string Name = "Void Drones";

		public const string Version = "0.48.6";
	}
	[BepInPlugin("VoidDrones", "Void Drones", "0.48.6")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		internal static Plugin Instance;

		internal static ConfigEntry<bool> HintsEnabled;

		internal static ConfigEntry<bool> HintSeenController;

		internal static ConfigEntry<bool> HintSeenFlight;

		internal static ConfigEntry<bool> HintSeenHiveMind;

		internal static ConfigEntry<Key> LaunchKey;

		internal static ConfigEntry<Key> KeyForward;

		internal static ConfigEntry<Key> KeyBack;

		internal static ConfigEntry<Key> KeyLeft;

		internal static ConfigEntry<Key> KeyRight;

		internal static ConfigEntry<Key> KeyUp;

		internal static ConfigEntry<Key> KeyDown;

		internal static ConfigEntry<Key> KeyRollLeft;

		internal static ConfigEntry<Key> KeyRollRight;

		internal static ConfigEntry<float> MouseSensitivity;

		internal static ConfigEntry<bool> InvertMouseY;

		internal static ConfigEntry<float> RollSpeed;

		internal static ConfigEntry<float> MinimumDroneSpeed;

		internal static ConfigEntry<float> SpeedMultiplier;

		internal static ConfigEntry<float> AccelerationTime;

		internal static ConfigEntry<float> TurnSmoothing;

		internal static ConfigEntry<float> MaxTurnRate;

		internal static ConfigEntry<float> RespawnDelay;

		internal static ConfigEntry<float> RespawnFreeDistance;

		internal static ConfigEntry<float> DroneScanRadius;

		internal static ConfigEntry<float> DroneHealthMultiplier;

		internal static ConfigEntry<float> EnginePitch;

		internal static ConfigEntry<float> MenuStatic;

		internal static ConfigEntry<float> BoostTrailBrightness;

		internal static ConfigEntry<float> CrystalSize;

		internal static ConfigEntry<float> CrystalDepth;

		internal static ConfigEntry<string> BackWallMaterials;

		internal static ConfigEntry<bool> MenuPreview;

		internal static ConfigEntry<bool> ControllerMonitor;

		internal static ConfigEntry<float> ControllerMonitorRange;

		internal static ConfigEntry<bool> ControllerMonitorFlipX;

		internal static ConfigEntry<bool> ControllerMonitorFlipY;

		internal static ConfigEntry<float> PreviewSpinSpeed;

		internal static ConfigEntry<float> PreviewZoom;

		internal static ConfigEntry<float> PreviewExposure;

		internal static ConfigEntry<float> PreviewLight;

		internal static ConfigEntry<float> CrosshairDistance;

		internal static ConfigEntry<float> ShipClearance;

		internal static ConfigEntry<float> AutopilotOrbitRadius;

		internal static ConfigEntry<float> AutopilotSpeed;

		internal static ConfigEntry<float> AutopilotFollowDistance;

		internal static ConfigEntry<float> AutopilotFollowRestart;

		internal static ConfigEntry<float> HiveMindTileSpacing;

		internal static ConfigEntry<float> AutopilotDodgeRange;

		internal static ConfigEntry<float> AutopilotDodgeMargin;

		internal static ConfigEntry<float> AutopilotJinkRange;

		internal static ConfigEntry<float> AutopilotLootRange;

		internal static ConfigEntry<float> AutopilotLootTimeout;

		internal static ConfigEntry<float> AutopilotLootCreepSpeed;

		internal static ConfigEntry<float> AutopilotLootBraking;

		internal static ConfigEntry<float> AutopilotExploreRange;

		internal static ConfigEntry<bool> AutopilotPrepareJump;

		internal static ConfigEntry<int> AutopilotLockCount;

		internal static ConfigEntry<float> AutopilotApproachDistance;

		internal static ConfigEntry<float> AutopilotAvoidRadius;

		internal static ConfigEntry<float> AutopilotAvoidLookahead;

		internal static ConfigEntry<float> AutopilotBossOrbitMin;

		internal static ConfigEntry<float> AutopilotBossOrbitMax;

		internal static ConfigEntry<float> AutopilotBossOrbitHeight;

		internal static ConfigEntry<bool> CruiseOnlyOnContact;

		internal static ConfigEntry<float> CruiseContactDistance;

		internal static ConfigEntry<float> AutopilotLootClearance;

		internal static ConfigEntry<float> AutopilotDefendRadius;

		internal static ConfigEntry<float> AutopilotAttackRadius;

		internal static ConfigEntry<float> AutopilotEvaParkDistance;

		internal static ConfigEntry<float> AutopilotAvoidEnemyRange;

		internal static ConfigEntry<float> AutopilotAvoidSmallRange;

		internal static ConfigEntry<float> AutopilotEvaParkHeight;

		internal static ConfigEntry<float> AutopilotEvaClearance;

		internal static ConfigEntry<float> AutopilotEvaParkGap;

		internal static ConfigEntry<bool> AutopilotVoiceLines;

		internal static ConfigEntry<float> AutopilotVoiceVolume;

		internal static ConfigEntry<bool> HiveMindChat;

		internal static ConfigEntry<bool> VerboseAutopilotLog;

		internal static ConfigEntry<float> EffectsVolume;

		internal static ConfigEntry<float> AutopilotAreaRange;

		internal static ConfigEntry<bool> AutopilotUseBoost;

		internal static ConfigEntry<bool> HiveMindPilotPerks;

		internal static ConfigEntry<float> AutopilotRetreatRange;

		internal static ConfigEntry<float> AutopilotSafeDistance;

		internal static ConfigEntry<float> AutopilotEscapeBoostDistance;

		internal static ConfigEntry<float> AutopilotFullThrustDistance;

		internal static ConfigEntry<Key> RemoteJumpKey;

		internal static ConfigEntry<float> AutopilotExploreTimeout;

		internal static ConfigEntry<Key> RearViewKey;

		internal static ConfigEntry<float> SwarmDamageBonus;

		internal static ConfigEntry<float> UpgradePlatingHealth;

		internal static ConfigEntry<bool> DamageEffects;

		internal static ConfigEntry<float> HiveMindScreenGap;

		internal static ConfigEntry<float> HiveMindScreenDepth;

		internal static ConfigEntry<float> HiveMindScreenWidth;

		internal static ConfigEntry<float> UpgradeWingsSpeed;

		internal static ConfigEntry<float> UpgradeWingsTurn;

		internal static ConfigEntry<float> UpgradeWingsScale;

		internal static ConfigEntry<float> UpgradeThrusterCooldown;

		internal static ConfigEntry<float> UpgradeThrusterDuration;

		internal static ConfigEntry<float> UpgradeThrusterLight;

		internal static ConfigEntry<float> UpgradeThrusterInset;

		internal static ConfigEntry<bool> UnlockAll;

		internal static ConfigEntry<float> HiveMindDropChance;

		internal static ConfigEntry<float> ReconChance;

		internal static ConfigEntry<float> ReconDelay;

		internal static ConfigEntry<int> ReconSites;

		internal static ConfigEntry<float> ReconScanDistance;

		internal static ConfigEntry<float> ReconScanTime;

		internal static ConfigEntry<float> ReconShipSpookDistance;

		internal static ConfigEntry<int> ReconReward;

		internal static ConfigEntry<string> ReconEnemies;

		internal static ConfigEntry<int> ReconWaveSize;

		internal static ConfigEntry<float> SwarmBoostRecharge;

		internal static ConfigEntry<float> SwarmRespawnDelay;

		internal static ConfigEntry<float> AmplifierRange;

		internal static ConfigEntry<float> AmplifierStatic;

		internal static ConfigEntry<float> AmplifierShieldPenalty;

		internal static ConfigEntry<float> AutopilotJinkAimAngle;

		internal static ConfigEntry<float> AutopilotJinkStrength;

		internal static ConfigEntry<bool> AutopilotPing;

		internal static ConfigEntry<float> AutopilotPingInterval;

		internal static ConfigEntry<float> AutopilotPingRange;

		internal static ConfigEntry<bool> CockpitHud;

		internal static ConfigEntry<float> ReticleLag;

		internal static ConfigEntry<bool> LaunchSequence;

		internal static ConfigEntry<float> LaunchDelay;

		internal static ConfigEntry<float> RecallDelay;

		internal static ConfigEntry<bool> ControllerStyle;

		internal static ConfigEntry<float> EngineVolume;

		internal static ConfigEntry<Key> MineDropKey;

		internal static ConfigEntry<float> MineCooldown;

		internal static ConfigEntry<float> MissileCooldown;

		internal static ConfigEntry<float> MissileDamage;

		internal static ConfigEntry<float> CarrierChance;

		internal static ConfigEntry<bool> CarrierEnabled;

		internal static ConfigEntry<bool> ReconEnabled;

		internal static ConfigEntry<float> CarrierCalamityTime;

		internal static ConfigEntry<float> CarrierHiveMindChance;

		internal static ConfigEntry<float> CarrierJumpInSpeed;

		internal static ConfigEntry<float> CarrierFireRate;

		internal static ConfigEntry<float> CarrierSpread;

		internal static ConfigEntry<float> ReconCalamityTime;

		internal static ConfigEntry<float> CarrierDelay;

		internal static ConfigEntry<float> CarrierDistance;

		internal static ConfigEntry<float> CarrierScale;

		internal static ConfigEntry<float> CarrierHealth;

		internal static ConfigEntry<float> CarrierWeaponDamage;

		internal static ConfigEntry<float> CarrierLaunchInterval;

		internal static ConfigEntry<int> CarrierMaxDrones;

		internal static ConfigEntry<float> CarrierEngageRange;

		internal static ConfigEntry<float> CarrierDroneHealth;

		internal static ConfigEntry<float> ClusterCooldown;

		internal static ConfigEntry<float> PlateShelfSpacing;

		internal static ConfigEntry<float> PlateShelfYaw;

		internal static ConfigEntry<float> PlateShelfForward;

		internal static ConfigEntry<float> ShelfRight;

		internal static ConfigEntry<float> ShelfUp;

		internal static ConfigEntry<float> ShelfForward;

		internal static ConfigEntry<int> ClusterCount;

		internal static ConfigEntry<float> SupportCrosshairDistance;

		internal static ConfigEntry<float> PlateCooldown;

		internal static ConfigEntry<float> ShieldDeviceCooldown;

		internal static ConfigEntry<float> ShieldFraction;

		internal static ConfigEntry<float> ShieldDuration;

		internal static ConfigEntry<float> HealRate;

		internal static ConfigEntry<float> WeldTime;

		internal static ConfigEntry<float> BreachRadius;

		internal static ConfigEntry<bool> HiveMindMap;

		internal static ConfigEntry<float> HiveMindMapSize;

		internal static ConfigEntry<float> HiveMindMapGap;

		internal static ConfigEntry<float> HiveMindMapRange;

		internal static ConfigEntry<float> HiveMindMapTilt;

		internal static ConfigEntry<float> MineLifetime;

		internal static ConfigEntry<float> MineDropDistance;

		internal static ConfigEntry<float> MineHuntRange;

		internal static ConfigEntry<float> MineChaseSpeed;

		internal static ConfigEntry<float> MineChaseTime;

		internal static ConfigEntry<float> MineBeamInterval;

		internal static ConfigEntry<float> MineBeamDamage;

		internal static ConfigEntry<float> MineBeamRange;

		internal static ConfigEntry<int> MineBurstCount;

		internal static ConfigEntry<float> MineBurstDamage;

		internal static ConfigEntry<float> MineBurstSpeed;

		internal static ConfigEntry<float> AbsolverDamage;

		internal static ConfigEntry<float> BestowerDamage;

		internal static ConfigEntry<float> BestowerFireRate;

		internal static ConfigEntry<float> ConfessorAccuracy;

		internal static ConfigEntry<float> ConfessorFireRate;

		internal static ConfigEntry<float> ConfessorDamage;

		internal static ConfigEntry<float> RespawnHealthThreshold;

		internal static ConfigEntry<float> TierBonus;

		internal static ConfigEntry<bool> ListenFromDrone;

		internal static ConfigEntry<float> DroneTargetRange;

		internal static ConfigEntry<float> DroneTargetBias;

		internal static ConfigEntry<bool> HideHudWithoutDrone;

		internal static ConfigEntry<float> CameraHeight;

		internal static ConfigEntry<float> CameraDistance;

		internal static ConfigEntry<bool> FirstPersonDefault;

		internal static ConfigEntry<float> FirstPersonBack;

		internal static ConfigEntry<float> Fisheye;

		internal static ConfigEntry<float> FirstPersonVignette;

		internal static ConfigEntry<Key> CameraToggleKey;

		internal static ConfigEntry<Key> SpotKey;

		internal static ConfigEntry<Key> CallKey;

		internal static ConfigEntry<float> RepairBoost;

		internal static ConfigEntry<float> StaticNearShip;

		internal static ConfigEntry<float> MaxRange;

		internal static ConfigEntry<float> WarningFraction;

		internal static ConfigEntry<float> NoiseCap;

		internal static ConfigEntry<float> NoiseCapFraction;

		internal static ConfigEntry<float> NoiseMax;

		internal static ConfigEntry<Key> KeyBoost;

		internal static ConfigEntry<float> StrafeSpeedMultiplier;

		internal static ConfigEntry<float> CollisionRadius;

		internal static ConfigEntry<int> CollisionLayerMask;

		internal static ConfigEntry<float> BoostSpeedMultiplier;

		internal static ConfigEntry<float> BoostDuration;

		internal static ConfigEntry<float> BoostCooldown;

		internal static ConfigEntry<float> BoostSteering;

		internal static ConfigEntry<float> BoostShake;

		internal static bool ChatOpen;

		private const int CurrentConfigVersion = 30;

		internal static bool InputBlocked
		{
			get
			{
				if (!ChatOpen)
				{
					return MenuScreenController.IsOpen();
				}
				return true;
			}
		}

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			HintsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Hints", "Enabled", true, "Show one-time tips the first time you use a Void Drone Controller, fly a drone and meet the Void Hive Mind.");
			HintSeenController = ((BaseUnityPlugin)this).Config.Bind<bool>("Hints", "SeenController", false, "Already shown (set to false to see it again).");
			HintSeenFlight = ((BaseUnityPlugin)this).Config.Bind<bool>("Hints", "SeenFlight", false, "Already shown (set to false to see it again).");
			HintSeenHiveMind = ((BaseUnityPlugin)this).Config.Bind<bool>("Hints", "SeenHiveMind", false, "Already shown (set to false to see it again).");
			LaunchKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Controls", "LaunchDrone", (Key)26, "Launch or recall the drone while seated in a Drone Bay.");
			KeyForward = ((BaseUnityPlugin)this).Config.Bind<Key>("Flight", "Forward", (Key)37, "");
			KeyBack = ((BaseUnityPlugin)this).Config.Bind<Key>("Flight", "Back", (Key)33, "");
			KeyLeft = ((BaseUnityPlugin)this).Config.Bind<Key>("Flight", "StrafeLeft", (Key)15, "");
			KeyRight = ((BaseUnityPlugin)this).Config.Bind<Key>("Flight", "StrafeRight", (Key)18, "");
			KeyUp = ((BaseUnityPlugin)this).Config.Bind<Key>("Flight", "Up", (Key)1, "Ascend (same as the ship's helm).");
			KeyDown = ((BaseUnityPlugin)this).Config.Bind<Key>("Flight", "Down", (Key)17, "Descend (same as the ship's helm).");
			KeyBoost = ((BaseUnityPlugin)this).Config.Bind<Key>("Flight", "Boost", (Key)51, "Boost (same as the ship's helm).");
			StrafeSpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "StrafeSpeedMultiplier", 0.475f, "Left/right strafe speed relative to forward speed.");
			CollisionRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "CollisionRadius", 4f, "Radius (m) of the drone's collision sphere. 0 = no collision.");
			CollisionLayerMask = ((BaseUnityPlugin)this).Config.Bind<int>("Flight", "CollisionLayerMask", 13312, "Physics layers the drone collides with (default = the layers the game's weapons hit: ships, asteroids, structures).");
			BoostSpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Boost", "SpeedMultiplier", 1.5f, "Top speed multiplier while boosting.");
			BoostDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Boost", "Duration", 3f, "Seconds a boost lasts.");
			BoostCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Boost", "Cooldown", 10f, "Seconds after a boost ends before the next one is ready.");
			BoostSteering = ((BaseUnityPlugin)this).Config.Bind<float>("Boost", "SteeringMultiplier", 0.5f, "Mouse and roll sensitivity while boosting.");
			BoostShake = ((BaseUnityPlugin)this).Config.Bind<float>("Boost", "CameraShake", 0.35f, "Camera shake strength while boosting (m). 0 = off.");
			KeyRollLeft = ((BaseUnityPlugin)this).Config.Bind<Key>("Flight", "RollLeft", (Key)31, "");
			KeyRollRight = ((BaseUnityPlugin)this).Config.Bind<Key>("Flight", "RollRight", (Key)19, "");
			MouseSensitivity = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "MouseSensitivity", 0.0935f, "Degrees of turn per pixel of mouse movement.");
			MaxTurnRate = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "MaxTurnRate", 110f, "Fastest pitch/yaw turn (degrees per second), however fast the mouse moves. 0 = unlimited.");
			InvertMouseY = ((BaseUnityPlugin)this).Config.Bind<bool>("Flight", "InvertMouseY", false, "");
			RollSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "RollSpeed", 99f, "Degrees per second.");
			MinimumDroneSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "MinimumSpeed", 80f, "Top speed floor (m/s) if the base ship's own top speed is lower.");
			SpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "SpeedMultiplier", 0.85f, "Multiplies the drone's top speed.");
			AccelerationTime = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "AccelerationTime", 1.21f, "Seconds to reach top speed from a standstill (and to stop again). Higher = more inertia.");
			TurnSmoothing = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "TurnSmoothing", 0.152f, "Turning inertia in seconds (time constant). 0 = instant. Try 0.2-0.4 for heavier handling.");
			HideHudWithoutDrone = ((BaseUnityPlugin)this).Config.Bind<bool>("DroneBay", "HideHudWithoutDrone", true, "Hide the turret HUD while seated in a Drone Bay until a drone is launched.");
			TierBonus = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "TierBonus", 0.05f, "Drone top speed and health bonus per controller upgrade (0.05 = +5% at MkII, +10% at MkIII).");
			RespawnFreeDistance = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "RespawnFreeDistance", 500f, "Distance part of the respawn delay: none within this distance (m) of the ship, rising to the full RespawnDelay at the control range limit. Added to the damage part (capped at the full delay). Host's setting applies.");
			RespawnDelay = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "RespawnDelay", 30f, "Longest wait (s) before a controller can launch again after its drone is lost or recalled. The actual wait is this times (damage part + distance part), capped here. Host's setting applies. 0 = off.");
			RespawnHealthThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "RespawnHealthThreshold", 0.75f, "Damage part of the respawn delay: none at or above this fraction of the drone's hull (0.75 = 75%), rising to the full RespawnDelay when it's destroyed.");
			MineDropKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Mine", "DropKey", (Key)21, "Use the drone's equipment while flying (picked in the controller's menu): a mine (Beam Mine from Energy drones, Burst Mine from Kinetic) or a missile (Kinetic: homing or cluster; Energy: energy missile or heavy torpedo); a Support drone's hull repair plate or drone shield device.");
			MineCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "Cooldown", 60f, "Seconds between mine drops, per controller. Host's setting applies.");
			MissileCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Equipment", "MissileCooldown", 20f, "Seconds between homing missiles (Kinetic) or energy missiles (Energy), per controller (the equipment timer is shared with the mine). Host's setting applies.");
			MissileDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Equipment", "MissileDamage", 1f, "Drone missile damage (homing, cluster, energy missile, heavy torpedo), relative to the game's own missiles. Every player should use the same value.");
			CarrierChance = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "Chance", 0.2f, "Chance (0-1) that a HOLLOW Carrier jumps in after the ship arrives in a mission sector (never the starting area, the run's first mission, or a sector with a Recon Sweep). 0 = never. Host's setting applies.");
			CarrierEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Carrier", "Enabled", true, "HOLLOW Carrier encounters happen (at Chance). Off = never (\"/drones carrier\" still works). Host's setting applies.");
			ReconEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Missions", "ReconEnabled", true, "The Recon Sweep side mission happens (at ReconChance). Off = never (\"/drones recon\" still works). Host's setting applies.");
			CarrierCalamityTime = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "CalamityTime", 0.2f, "A HOLLOW Carrier in the sector makes its calamity countdown (Reclaimer, void sanction, void bomb) this much longer (0.2 = +20%). Host's setting applies.");
			ReconCalamityTime = ((BaseUnityPlugin)this).Config.Bind<float>("Missions", "ReconCalamityTime", 0.1f, "A Recon Sweep in the sector makes its calamity countdown (Reclaimer, void sanction, void bomb) this much longer (0.1 = +10%). Host's setting applies.");
			CarrierHiveMindChance = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "HiveMindChance", 0.15f, "Chance (0-1) that a destroyed HOLLOW Carrier also drops a Void Hive Mind (it always drops a drone controller). Host's setting applies.");
			CarrierJumpInSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "JumpInSpeed", 2f, "How much faster than the Reclaimer the HOLLOW Carrier charges and makes its jump in (2 = twice as fast, half the time). Read when the game loads.");
			CarrierFireRate = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "FireRate", 0.64f, "Fire rate of the HOLLOW Carrier's own guns, relative to the Reclaimer's (0.8 = 20% slower). Host's setting applies.");
			CarrierSpread = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "Spread", 12f, "Extra scatter (degrees) on the HOLLOW Carrier's shots, so it misses more than the Reclaimer. Read when the game loads.");
			CarrierDelay = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "Delay", 60f, "Seconds after arriving in a sector before the HOLLOW Carrier jumps in.");
			CarrierDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "Distance", 3000f, "How far from the ship (m) the HOLLOW Carrier jumps in.");
			CarrierScale = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "Scale", 0.5f, "Size of the HOLLOW Carrier relative to the HOLLOW Reclaimer it's built from. Every player should use the same value. Read when the game loads.");
			CarrierHealth = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "Health", 3200f, "HOLLOW Carrier hull hit points. Every player should use the same value.");
			CarrierWeaponDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "WeaponDamage", 0.12f, "Damage of the HOLLOW Carrier's own guns, relative to the Reclaimer's (0.15 = 15%). Every player should use the same value.");
			CarrierLaunchInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "LaunchInterval", 12f, "Seconds between the HOLLOW Carrier's drone launches. Host's setting applies.");
			CarrierMaxDrones = ((BaseUnityPlugin)this).Config.Bind<int>("Carrier", "MaxDrones", 2, "Most HOLLOW Drone wings (each a wing of interceptor fighters with our drone's look) a carrier has out at once. Host's setting applies.");
			CarrierEngageRange = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "EngageRange", 4000f, "The HOLLOW Carrier launches drones while the ship is within this distance (m). Host's setting applies.");
			CarrierDroneHealth = ((BaseUnityPlugin)this).Config.Bind<float>("Carrier", "DroneHealth", 0.5f, "HOLLOW Drone hull relative to the Hollow Morph (0.5 = half, like our drones). Every player should use the same value.");
			PlateShelfSpacing = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "PlateShelfSpacing", 0.8f, "Support controller: spacing (m) between its two repair plate slots. Read when the game loads.");
			PlateShelfYaw = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "PlateShelfYaw", 90f, "Support controller: turn (degrees) of each repair plate slot, relative to the seat.");
			ShelfRight = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "ShelfRight", 0.9f, "Support controller: how far to the right of the seat (m) its repair plate shelf sits (negative = left).");
			ShelfUp = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "ShelfUp", 0.15f, "Support controller: height (m) above the seat's base of the underside of its repair plate shelf (0 = the floor the seat stands on).");
			ShelfForward = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "ShelfForward", -0.9f, "Support controller: how far in front of the seat (m) its repair plate shelf sits (negative = behind); its two slots run front to back from there.");
			PlateShelfForward = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "PlateShelfForward", 1f, "Support controller: how far forward (m) its repair plate shelf sits. Read when the game loads.");
			ClusterCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Equipment", "ClusterMissileCooldown", 35f, "Seconds between cluster missile salvos (Kinetic) or heavy torpedoes (Energy), per controller. Host's setting applies.");
			ClusterCount = ((BaseUnityPlugin)this).Config.Bind<int>("Equipment", "ClusterMissileCount", 6, "Small missiles per cluster missile salvo. Host's setting applies.");
			SupportCrosshairDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Camera", "SupportCrosshairDistance", 200f, "Third person, Support drones: the crosshair sits where the beam is this far ahead (m); closer than CrosshairDistance, since a Support drone works up close.");
			PlateCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Equipment", "RepairPlateCooldown", 15f, "Seconds between hull repair plates from a Support drone. Host's setting applies.");
			ShieldDeviceCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Equipment", "ShieldDeviceCooldown", 25f, "Seconds between drone shield devices from a Support drone. Host's setting applies.");
			ShieldFraction = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "ShieldFraction", 0.5f, "Drone shield device: shield hit points as a share of the shielded drone's max hull (0.5 = 50%). Host's setting applies.");
			ShieldDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "ShieldDuration", 45f, "Drone shield device: seconds the shield lasts if it isn't used up first. 0 = until used up. Host's setting applies.");
			HealRate = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "HealRate", 0.12f, "Healing beam: share of a drone's max hull repaired per second of beam on it (0.12 = 12%), times the controller's damage bonuses. Host's setting applies.");
			WeldTime = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "WeldTime", 2f, "Healing beam: seconds the beam must stay on a hull breach to repair it (a major breach needs a repair plate in it first).");
			BreachRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Support", "BreachRadius", 20f, "Healing beam: the beam works on a hull breach when it hits the hull within this distance (m) of it.");
			HiveMindMap = ((BaseUnityPlugin)this).Config.Bind<bool>("Autopilot", "CommandMap", true, "Show the Void Hive Mind's command map (the ship, drones, enemies and objectives seen from above) on a screen above its brain.");
			HiveMindMapSize = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "CommandMapSize", 1f, "Size of the command map screen, relative to the Hive Mind's mode-tile panel width.");
			HiveMindMapGap = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "CommandMapGap", 0.05f, "Gap between the top of the Hive Mind's brain and the command map (in the tile panel's own units).");
			HiveMindMapTilt = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "CommandMapTilt", 15f, "How far (degrees) the command map tilts towards the viewer, hinged on its bottom edge.");
			HiveMindMapRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "CommandMapRange", 2500f, "Distance (m) from the ship to the command map's edge.");
			MineLifetime = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "Lifetime", 180f, "A mine that hasn't exploded is removed after this many seconds. 0 = never. Host's setting applies.");
			MineDropDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "DropDistance", 15f, "How far behind the drone the mine appears (m).");
			MineHuntRange = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "HuntRange", 1200f, "The mine locks onto the nearest enemy within this distance (m). Host's setting applies.");
			MineChaseSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "ChaseSpeed", 140f, "Top chase speed (m/s); the mine reaches it 1.5 s after locking on. Host's setting applies.");
			MineChaseTime = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "ChaseTime", 20f, "Seconds the mine chases a target before it self-destructs. Host's setting applies.");
			MineBeamInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "BeamInterval", 2.5f, "Seconds between the mine's shots at its target (Beam Mine: a Beamcaster ray; Burst Mine: a Litany burst). 0 = no shots. Host's setting applies.");
			MineBeamDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "BeamDamage", 0.12f, "Damage of each Beamcaster ray (Beam Mines, from Energy drones), as a fraction of the mine's blast damage. Host's setting applies.");
			MineBeamRange = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "BeamRange", 700f, "The mine fires only at targets within this distance (m). Host's setting applies.");
			MineBurstCount = ((BaseUnityPlugin)this).Config.Bind<int>("Mine", "BurstCount", 5, "Litany Minigun rounds per burst (Burst Mines, from Kinetic drones).");
			MineBurstDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "BurstDamage", 0.03f, "Damage of each Litany round (Burst Mines), as a fraction of the mine's blast damage. Host's setting applies.");
			MineBurstSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Mine", "BurstSpeed", 500f, "Speed (m/s) of the Burst Mine's Litany rounds; they're aimed ahead of moving targets.");
			AbsolverDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Balance", "AbsolverLanceDamage", 0.75f, "Damage multiplier for the Absolver Lance on a drone. Every player should use the same balance values.");
			BestowerDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Balance", "BestowerFlakDamage", 0.85f, "Damage multiplier for the Bestower Flak Cannon on a drone.");
			BestowerFireRate = ((BaseUnityPlugin)this).Config.Bind<float>("Balance", "BestowerFlakFireRate", 0.85f, "Fire rate multiplier for the Bestower Flak Cannon on a drone.");
			ConfessorAccuracy = ((BaseUnityPlugin)this).Config.Bind<float>("Balance", "ConfessorCarronadeAccuracy", 1.8f, "Base accuracy multiplier for the Confessor Carronade on a drone (2 = half the spread).");
			ConfessorFireRate = ((BaseUnityPlugin)this).Config.Bind<float>("Balance", "ConfessorCarronadeFireRate", 1.125f, "Fire rate multiplier for the Confessor Carronade on a drone.");
			ConfessorDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Balance", "ConfessorCarronadeDamage", 1.1f, "Damage multiplier for the Confessor Carronade on a drone.");
			ControllerStyle = ((BaseUnityPlugin)this).Config.Bind<bool>("DroneBay", "ControllerStyle", true, "Give installed controllers their own look: weapon machinery removed (seat and screen kept), silver panels, glow in the drone colour.");
			CrystalSize = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "CrystalSize", 1.2f, "Size (m) of the drone crystals on the controller's back wall.");
			CrystalDepth = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "CrystalDepth", 0.35f, "How far (m) in front of the back wall the crystals sit.");
			BackWallMaterials = ((BaseUnityPlugin)this).Config.Bind<string>("DroneBay", "BackWallMaterials", "Metal_GreyDark_Mat", "Materials of the controller's back frame (behind the canisters) painted black, comma-separated. The log's 'MK2 frame' line lists them.");
			MenuPreview = ((BaseUnityPlugin)this).Config.Bind<bool>("DroneBay", "MenuPreview", true, "Show a spinning model of the controller's drone at the top of the pre-launch weapon menu.");
			ControllerMonitor = ((BaseUnityPlugin)this).Config.Bind<bool>("DroneBay", "ControllerMonitor", true, "Mirror the pre-launch menu on the controller's own monitor while the controller is switched on, so it can be read from outside the seat.");
			ControllerMonitorRange = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "ControllerMonitorRange", 25f, "The controller monitor is only drawn within this distance of the camera (metres).");
			ControllerMonitorFlipX = ((BaseUnityPlugin)this).Config.Bind<bool>("DroneBay", "ControllerMonitorFlipX", false, "Mirror the controller monitor's menu left-right (if it shows mirrored).");
			ControllerMonitorFlipY = ((BaseUnityPlugin)this).Config.Bind<bool>("DroneBay", "ControllerMonitorFlipY", false, "Flip the controller monitor's menu upside down (if it shows upside down).");
			PreviewZoom = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "PreviewZoom", 1.5f, "Zoom of the menu's drone model (1 = the whole model fits, 1.5 = 1.5x closer).");
			PreviewSpinSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "PreviewSpinSpeed", 30f, "Turntable speed of the menu's drone model (degrees per second).");
			PreviewExposure = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "PreviewExposure", 6f, "Exposure (EV100) of the menu's drone model: higher is darker.");
			PreviewLight = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "PreviewLight", 40000f, "Brightness of the lights on the menu's drone model.");
			LaunchSequence = ((BaseUnityPlugin)this).Config.Bind<bool>("DroneBay", "LaunchSequence", true, "Launch and recall sequence: link-up and signal screens, the drone warping in and out, the controller's lights reacting. Off = instant launch and recall. The host's setting decides the timing.");
			LaunchDelay = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "LaunchDelay", 0.8f, "Seconds between pressing launch and the drone appearing (the link-up). Host's setting applies.");
			RecallDelay = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "RecallDelay", 0.5f, "Seconds the drone spins down before warping out when recalled (void jump and range recalls use at most 0.3). Host's setting applies.");
			BoostTrailBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Boost", "TrailBrightness", 4f, "How much brighter the drone's exhaust trail glows while boosting (1 = no change). It also gets 50% wider.");
			MenuStatic = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "MenuStatic", 0.0765f, "Strength of the TV static on the pre-launch screen (0 = off, 1 = solid noise).");
			EnginePitch = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "EnginePitch", 2f, "Pitch of the drone's engine, thrust and boost sounds (the ship's own sounds; 2 = one octave higher).");
			EngineVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "EngineVolume", 1f, "Volume of the drone's engine, thrust and boost sounds (0-1+).");
			DroneHealthMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "HealthMultiplier", 0.5f, "Drone max health relative to the Hollow Morph it's built from (0.5 = half). Every player should use the same value.");
			DroneScanRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Range", "DroneScanRadius", 600f, "Drones passively scan objects within this distance (m), like the ship does around itself. 0 = off. Host's setting applies.");
			DroneTargetRange = ((BaseUnityPlugin)this).Config.Bind<float>("Enemies", "DroneTargetRange", 800f, "Enemies within this distance (m) of a drone may pick it as their target. Drones that shoot enemies also draw their aggro.");
			DroneTargetBias = ((BaseUnityPlugin)this).Config.Bind<float>("Enemies", "DroneTargetBias", 0.6f, "How strongly drones draw fire: an enemy targets a drone when its distance x this is closer than its current target. Lower = drones attract more fire.");
			ListenFromDrone = ((BaseUnityPlugin)this).Config.Bind<bool>("Audio", "ListenFromDrone", true, "While flying, hear the game from the drone's camera instead of from the gunner seat on the ship.");
			ShipClearance = ((BaseUnityPlugin)this).Config.Bind<float>("Flight", "ShipClearance", 100f, "Drones can fly this close (m) to the ship's hull before its repulsion field pushes the ship away (and drops cruise mode / the Void Hive Mind).");
			CameraHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Camera", "Height", 7.7f, "Chase camera height above the drone (m).");
			AutopilotOrbitRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "OrbitRadius", 500f, "Radius (m) of the circle flown around the active mission objective. Host's setting applies.");
			AutopilotSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "Speed", 0.5f, "Cruising speed while circling or following, as a fraction of the ship's top speed (0-1). Host's setting applies.");
			AutopilotFollowDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "FollowDistance", 300f, "Drones focus: the ship holds still while any deployed drone is within this distance (m) of it, and closes back in to it when they fly further off. Host's setting applies.");
			HiveMindTileSpacing = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "TileSpacing", 0.41f, "Distance between the Void Hive Mind's mode tile symbols, as a fraction of the tile panel's length (0.33 = even thirds). Raise it if the outer symbols sit too far in.");
			AutopilotFollowRestart = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "FollowRestart", 1.6f, "The ship only sets off again once the drones are this many times FollowDistance away (a dead zone, so it doesn't keep correcting). Host's setting applies.");
			AutopilotDodgeRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "DodgeRange", 1500f, "Incoming enemy missiles within this distance (m) are tracked for dodging. 0 = no dodging. Host's setting applies.");
			AutopilotDodgeMargin = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "DodgeMargin", 120f, "A missile that will pass closer than this (m) is dodged. Host's setting applies.");
			ReconChance = ((BaseUnityPlugin)this).Config.Bind<float>("Missions", "ReconChance", 0.34f, "Chance (0-1) that a Recon Sweep starts in a newly entered sector, if the ship has a drone controller. 0 = never. Host's setting applies.");
			ReconDelay = ((BaseUnityPlugin)this).Config.Bind<float>("Missions", "ReconDelay", 30f, "Seconds after arriving in a sector before a Recon Sweep starts.");
			ReconSites = ((BaseUnityPlugin)this).Config.Bind<int>("Missions", "ReconSites", 3, "Signal anomalies to scan per Recon Sweep (1-6).");
			ReconScanDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Missions", "ReconScanDistance", 150f, "A drone must be within this distance (m) of an anomaly to scan it.");
			ReconScanTime = ((BaseUnityPlugin)this).Config.Bind<float>("Missions", "ReconScanTime", 4f, "Seconds a drone must stay near an anomaly to scan it.");
			ReconShipSpookDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Missions", "ReconShipSpookDistance", 400f, "An unscanned anomaly jumps away if the ship comes this close (m). 0 = never.");
			ReconReward = ((BaseUnityPlugin)this).Config.Bind<int>("Missions", "ReconReward", 20, "Alloys awarded when a Recon Sweep is completed.");
			ReconEnemies = ((BaseUnityPlugin)this).Config.Bind<string>("Missions", "ReconEnemies", "Interceptor Wing", "Ships that jump in during a Recon Sweep: any spacecraft whose name or in-game name contains one of these (comma-separated). The matches are logged. Host's setting applies.");
			ReconWaveSize = ((BaseUnityPlugin)this).Config.Bind<int>("Missions", "ReconWaveSize", 2, "Ships per wave. A Recon Sweep has two waves: one guarding the anomalies from the start, one when the first anomaly is scanned (0 = none).");
			HiveMindScreenWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "StatusScreenWidth", 1.45f, "Width of the Void Hive Mind's status screen, relative to its mode-tile panel.");
			HiveMindScreenGap = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "StatusScreenGap", 0.11f, "If the indicator lights above the Void Hive Mind's mode tiles aren't found: gap between the tiles and its status screen above them (in the tile panel's own units).");
			HiveMindScreenDepth = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "StatusScreenDepth", 0.03f, "If the indicator lights aren't found: how far behind the front of the mode tiles the status screen sits (in the tile panel's own units).");
			DamageEffects = ((BaseUnityPlugin)this).Config.Bind<bool>("Drones", "DamageEffects", true, "Damaged drones throw sparks (below half hull) and smoke (below a quarter); the pilot gets a red warning edge and HULL CRITICAL below 30%.");
			UpgradePlatingHealth = ((BaseUnityPlugin)this).Config.Bind<float>("Upgrades", "PlatingHealth", 0.4f, "Drone Reinforced Plating: extra drone hull (0.4 = +40%).");
			UpgradeWingsSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Upgrades", "WingsSpeed", 0.12f, "Drone Extended Wings: extra drone top speed (0.12 = +12%).");
			UpgradeWingsTurn = ((BaseUnityPlugin)this).Config.Bind<float>("Upgrades", "WingsTurn", 0.15f, "Drone Extended Wings: faster drone turning (0.15 = +15%).");
			UpgradeWingsScale = ((BaseUnityPlugin)this).Config.Bind<float>("Upgrades", "WingsScale", 1.35f, "Drone Extended Wings: how much bigger the wings look.");
			UpgradeThrusterCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Upgrades", "ThrusterCooldown", 0.4f, "Drone Overcharged Thrusters: shorter boost cooldown (0.4 = 40% shorter).");
			UpgradeThrusterDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Upgrades", "ThrusterDuration", 0.25f, "Drone Overcharged Thrusters: longer boost (0.25 = +25%).");
			UpgradeThrusterLight = ((BaseUnityPlugin)this).Config.Bind<float>("Upgrades", "ThrusterLight", 40000f, "Drone Overcharged Thrusters: brightness of the two engine lights.");
			UnlockAll = ((BaseUnityPlugin)this).Config.Bind<bool>("Unlocks", "UnlockAll", false, "Every Void Drones item can be made at the Fabricator from the start of a run. The host's setting applies to everyone in the session. Off, they work like vanilla's locked items: recycle one found as loot to learn it; the upgrade mods and the Void Hive Mind also come with Fabricator upgrades. Also \"/drones unlock\" in chat.");
			HiveMindDropChance = ((BaseUnityPlugin)this).Config.Bind<float>("Unlocks", "HiveMindDropChance", 1.5f, "How often the Void Hive Mind drops as loot compared with the Auto-Mechanic (1.5 = 50% more often; 1 = the same).");
			UpgradeThrusterInset = ((BaseUnityPlugin)this).Config.Bind<float>("Upgrades", "ThrusterInset", 0.16f, "Drone Overcharged Thrusters: how far forward from the back of the wing's model box the nozzles end, as a share of the wing's length (the model box reaches past the visible wing). Raise it if the nozzles stick out behind the wings.");
			SwarmDamageBonus = ((BaseUnityPlugin)this).Config.Bind<float>("Relics", "SwarmDamageBonus", 0.15f, "Swarm Resonance: extra drone damage (0.15 = +15%). Host's and every client's values should match.");
			SwarmBoostRecharge = ((BaseUnityPlugin)this).Config.Bind<float>("Relics", "SwarmBoostRecharge", 1.5f, "Swarm Resonance: boost recharge speed (1.5 = cooldown 1.5x as fast).");
			SwarmRespawnDelay = ((BaseUnityPlugin)this).Config.Bind<float>("Relics", "SwarmRespawnDelay", 45f, "Swarm Resonance drawback: seconds before a lost drone's controller can launch again.");
			AmplifierRange = ((BaseUnityPlugin)this).Config.Bind<float>("Relics", "AmplifierRange", 3000f, "Signal Amplifier: drone control range (m).");
			AmplifierStatic = ((BaseUnityPlugin)this).Config.Bind<float>("Relics", "AmplifierStatic", 0.3f, "Signal Amplifier: how much weaker the signal static is (0.3 = 30% weaker).");
			AmplifierShieldPenalty = ((BaseUnityPlugin)this).Config.Bind<float>("Relics", "AmplifierShieldPenalty", 0.2f, "Signal Amplifier drawback: ship shield recharge slowdown (0.2 = 20% slower). Read when the game loads.");
			AutopilotLootRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "LootRange", 1500f, "Loose items within this distance (m) of the ship are collected with the gravity scoop (every focus but Evasive), but only while a gravity scoop is installed, powered and has a free slot. While drones are out, only items near them. 0 = no looting. Host's setting applies.");
			AutopilotLockCount = ((BaseUnityPlugin)this).Config.Bind<int>("Autopilot", "LockCount", 2, "The Void Hive Mind puts the ship's target locks on up to this many enemies in ping range: mission targets first, then the bigger ships, small fighters last. It uses only free lock slots or its own locks (never the crew's). 0 = no locking. Host's setting applies.");
			AutopilotApproachDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "ApproachDistance", 300f, "For mission steps worded like \"Approach ...\" or \"Fly to ...\" (without a set distance), the Hive Mind flies within 60% of this distance (m) of the marker and waits there (Objectives focus).");
			AutopilotAvoidRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "AvoidRadius", 60f, "Clearance (m) the autopilot keeps from asteroids, wrecks and other objects in its path. 0 = no avoidance.");
			AutopilotBossOrbitMin = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "BossOrbitMin", 800f, "In a boss fight the Hive Mind orbits the boss, keeping it between BossOrbitMin and BossOrbitMax (m) away (any focus).");
			AutopilotBossOrbitMax = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "BossOrbitMax", 1000f, "Outer edge of the boss orbit (m). 0 = no boss orbit.");
			AutopilotBossOrbitHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "BossOrbitHeight", 75f, "Height (m) above the boss the Hive Mind orbits at, clear of what flies around it (the Matriarch's nodes).");
			CruiseOnlyOnContact = ((BaseUnityPlugin)this).Config.Bind<bool>("Autopilot", "CruiseOnlyOnContact", true, "Cruise mode (and the Void Hive Mind) only switches off when something actually reaches the hull, not whenever it comes inside the ship's bumper zone.");
			CruiseContactDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "CruiseContactDistance", 3f, "With CruiseOnlyOnContact: how close (m) to the hull counts as contact.");
			AutopilotDefendRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "DefendRadius", 600f, "Objectives focus, a defend step: the Hive Mind orbits the defended object at this distance (m).");
			AutopilotAttackRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "AttackRadius", 900f, "Objectives focus, a destroy step: the Hive Mind orbits the target at this distance (m), in turret range.");
			AutopilotAvoidEnemyRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "AvoidEnemyRange", 60f, "Obstacle avoidance: enemy ships are only steered around when this close ahead (m); they move, and the Hive Mind fights them at range.");
			AutopilotAvoidSmallRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "AvoidSmallRange", 120f, "Obstacle avoidance: mines and small loose objects (chests, crates, debris) are only steered around when this close ahead (m).");
			AutopilotEvaParkDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "EvaParkDistance", 100f, "Objectives focus, a step done on EVA: the Hive Mind parks beside it on the side it arrives from, rear turned to it, and waits; at least 60% of this distance (m) out, and EvaClearance beyond the structure.");
			AutopilotVoiceLines = ((BaseUnityPlugin)this).Config.Bind<bool>("Audio", "AutopilotVoice", true, "Void Drones voice lines: Void Hive Mind and drone controller power on / off, and (with a powered Hive Mind aboard) \"autopilot on / off\" in place of the helm's cruise mode announcements.");
			AutopilotVoiceVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "AutopilotVoiceVolume", 1f, "Volume of the Void Drones voice lines (0-1+).");
			HiveMindChat = ((BaseUnityPlugin)this).Config.Bind<bool>("Autopilot", "ChatUpdates", false, "Post the Void Hive Mind's routine updates (what it's doing, focus changes, boosts) in chat. Off: its status screen and voice lines show them; important messages still post.");
			VerboseAutopilotLog = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "DetailedAutopilotLog", false, "Write the Void Hive Mind's detailed flight log (every obstacle it steers around, parking progress every 2 s) to BepInEx/LogOutput.log. For testers tuning the autopilot.");
			EffectsVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "EffectsVolume", 1f, "Volume of the Void Drones sound effects: menu ticks and clicks, drone launch and recall, mine lock (0 = off).");
			AutopilotEvaParkGap = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "EvaParkGap", 25f, "EVA parking: how far (m) out from the edge of the objective's structure the ship backs in to (its rear that close).");
			AutopilotEvaClearance = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "EvaClearance", 70f, "EVA parking: how far (m) beyond the edge of the objective's structure the ship parks, on the side it arrives from.");
			AutopilotEvaParkHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "EvaParkHeight", 60f, "EVA parking: how far (m) above the objective's level the Hive Mind parks. On the way in it stays at least 80 m above the objective (or this, if higher) until it is near the staging point.");
			AutopilotRetreatRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "RetreatRange", 4000f, "Evasive focus (retreat and repair): enemies within this distance (m) push the ship away.");
			AutopilotSafeDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "SafeDistance", 2500f, "Evasive focus: once no enemy is this close (m) and no fire is incoming, the ship holds still for repairs.");
			AutopilotFullThrustDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "FullThrustDistance", 500f, "Heading for a mission target (fly-to, attack, defend, EVA parking) more than this far (m) away, the Hive Mind uses full thrust.");
			AutopilotEscapeBoostDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "EscapeBoostDistance", 200f, "Evasive focus: with an enemy this close (m), the Hive Mind boosts away (needs a charged thruster booster and UseBoost).");
			AutopilotUseBoost = ((BaseUnityPlugin)this).Config.Bind<bool>("Autopilot", "UseBoost", true, "The Void Hive Mind fires a charged thruster booster to catch up with drones far ahead in open space, and to dodge big attacks (a sniper locking on to the ship, a bomber run). Host's setting applies.");
			HiveMindPilotPerks = ((BaseUnityPlugin)this).Config.Bind<bool>("Autopilot", "PilotPerks", true, "While the Void Hive Mind flies the ship (and nobody sits at the helm), it brings a full pilot skill tree: every Pilot perk at its top level, as if a maxed-out pilot were seated. A player who sits at the helm brings their own perks instead. The host's setting decides how the ship flies.");
			AutopilotAreaRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "AreaRange", 5000f, "The Hive Mind keeps to the area where the action is (mission markers, enemies and objects within this distance, m): it roams there when idle and comes back if it strays. 0 = off.");
			AutopilotLootClearance = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "LootClearance", 100f, "Loose items within this distance (m) of an asteroid, wreck or other object are left alone (the ship would scrape past it).");
			AutopilotAvoidLookahead = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "AvoidLookahead", 5f, "How many seconds of travel ahead the autopilot checks for obstacles.");
			AutopilotPrepareJump = ((BaseUnityPlugin)this).Config.Bind<bool>("Autopilot", "PrepareJump", true, "Once the sector's main objective is complete, a powered Void Hive Mind charges the void drive and sets the escape vector. Host's setting applies.");
			RemoteJumpKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Autopilot", "RemoteJumpKey", (Key)24, "In a Void Drone Controller seat, press twice to pull the void jump lever remotely (needs a powered Void Hive Mind and the escape vector set).");
			AutopilotExploreRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "ExploreRange", 4000f, "With nothing else to do (Objectives and Drones focus), the Hive Mind flies to unscanned, non-hostile objects within this distance (m) until the ship scans them. 0 = no exploring. Host's setting applies.");
			AutopilotExploreTimeout = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "ExploreTimeout", 90f, "Seconds to try to reach one object before skipping it for five minutes.");
			AutopilotLootBraking = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "LootBraking", 2f, "How hard (m/s per second) the ship eases off on its way in to an item. Lower = starts slowing earlier and smoother.");
			AutopilotLootCreepSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "LootCreepSpeed", 4f, "Speed (m/s) the ship eases forward at once an item is close or being pulled in by the scoop.");
			AutopilotLootTimeout = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "LootTimeout", 40f, "Seconds to try for one item before ignoring it for two minutes.");
			AutopilotJinkRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "JinkRange", 800f, "Enemies within this distance (m) that target the ship or point their nose at it make the autopilot jink (sidestep in changing directions) to throw off their aim. Evasive focus: 1.5x. 0 = no jinking. Host's setting applies.");
			AutopilotJinkAimAngle = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "JinkAimAngle", 20f, "An enemy whose nose points within this angle (degrees) of the ship counts as aiming at it.");
			AutopilotJinkStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "JinkStrength", 0.8f, "Sidestep speed as a share of the ship's top speed (Evasive focus; other focuses use 60% of it).");
			AutopilotPing = ((BaseUnityPlugin)this).Config.Bind<bool>("Autopilot", "AutoPing", true, "The Void Hive Mind pings each mission item out in space once, for the crew (enemies get target locks instead, see LockCount). Host's setting applies.");
			AutopilotPingInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "PingInterval", 6f, "Seconds between automatic pings. Host's setting applies.");
			AutopilotPingRange = ((BaseUnityPlugin)this).Config.Bind<float>("Autopilot", "PingRange", 1500f, "Only targets within this distance (m) of the ship are pinged. Host's setting applies.");
			CockpitHud = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera", "CockpitHud", true, "First person: fighter-style HUD in the drone's colour (flight-path marker, horizon and pitch ladder relative to your ship, speed and hull beside the crosshair).");
			ReticleLag = ((BaseUnityPlugin)this).Config.Bind<float>("Camera", "ReticleLag", 1f, "How far the HUD lags behind turns before settling: the crosshair, the turret HUD and the info panel in both views, plus the first-person readouts (0 = fixed, 1 = default, 2 = double).");
			CrosshairDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Camera", "CrosshairDistance", 500f, "Third person: the crosshair sits where the drone's shots are this far ahead (m), below the screen centre because the camera is above the drone. 0 = screen centre.");
			CameraDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Camera", "Distance", 28f, "Chase camera distance behind the drone (m).");
			FirstPersonDefault = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera", "FirstPersonDefault", false, "Start in first-person view (camera at the drone's nose).");
			FirstPersonBack = ((BaseUnityPlugin)this).Config.Bind<float>("Camera", "FirstPersonBack", 6f, "First person: how far behind the muzzle the camera sits (m); about 6 puts it on the nose.");
			Fisheye = ((BaseUnityPlugin)this).Config.Bind<float>("Camera", "Fisheye", 0.12f, "First person: strength of the slight fish-eye lens (0 = off, 0.3 = strong).");
			FirstPersonVignette = ((BaseUnityPlugin)this).Config.Bind<float>("Camera", "Vignette", 0.25f, "First person: darkening towards the screen edges (0 = off, 0.5 = strong).");
			SpotKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Camera", "SpotKey", (Key)34, "While flying: spot what the drone is looking at (an enemy gets one of the ship's target locks, anything else a ping).");
			CallKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Autopilot", "CallKey", (Key)22, "While flying: ask a powered Void Hive Mind to bring the ship to your drone (needs cruise mode).");
			RepairBoost = ((BaseUnityPlugin)this).Config.Bind<float>("DroneBay", "RepairBoost", 0.5f, "While a controller is powered, its next drone is repaired this much faster (0.5 = the respawn delay counts down 1.5x as fast; 0 = off).");
			CameraToggleKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Camera", "ToggleViewKey", (Key)36, "Switch between chase and first-person view while flying.");
			RearViewKey = ((BaseUnityPlugin)this).Config.Bind<Key>("Camera", "RearViewKey", (Key)3, "Hold to look straight back from the chase view (no HUD while held). Not in first person.");
			StaticNearShip = ((BaseUnityPlugin)this).Config.Bind<float>("Range", "StaticNearShip", 0.1f, "Film-grain static right next to the ship (0-1). It rises to full at MaxRange.");
			MaxRange = ((BaseUnityPlugin)this).Config.Bind<float>("Range", "MaxRange", 2000f, "Control range (m) from the ship. The view fills with static towards it; beyond it the drone is recalled.");
			WarningFraction = ((BaseUnityPlugin)this).Config.Bind<float>("Range", "WarningFraction", 0.1f, "The flashing turn-back warning shows in the last part of MaxRange (0.1 = last 10%, i.e. 200 m at 2 km).");
			NoiseCap = ((BaseUnityPlugin)this).Config.Bind<float>("Range", "NoiseCap", 0.2f, "Screen noise stays at or below this (0-1) until NoiseCapFraction of MaxRange.");
			NoiseCapFraction = ((BaseUnityPlugin)this).Config.Bind<float>("Range", "NoiseCapFraction", 0.9f, "Noise stays at or below NoiseCap until this fraction of MaxRange (0.9 = 1800 m at 2 km), then rises to NoiseMax at MaxRange.");
			NoiseMax = ((BaseUnityPlugin)this).Config.Bind<float>("Range", "NoiseMax", 0.9f, "Strongest screen noise (0-1), reached at MaxRange.");
			MigrateConfig();
			ApplyPatches();
			Log.LogInfo((object)"Void Drones 0.48.6 loaded. Hello, Void!");
		}

		private void MigrateConfig()
		{
			ConfigEntry<int> val = ((BaseUnityPlugin)this).Config.Bind<int>("Internal", "ConfigVersion", 0, "Used to update old default settings. Don't edit.");
			if (val.Value < 30)
			{
				Migrate(AccelerationTime, 1.05f);
				Migrate(TurnSmoothing, 0.132f);
				Migrate(MouseSensitivity, 0.1f);
				Migrate(CameraHeight, 9f);
				Migrate(StrafeSpeedMultiplier, 0.5f);
				Migrate(MouseSensitivity, 0.085f);
				Migrate(MaxTurnRate, 100f);
				Migrate(RollSpeed, 90f);
				Migrate(CameraHeight, 8.1f);
				Migrate(ConfessorAccuracy, 2f);
				Migrate(ConfessorFireRate, 1.25f);
				Migrate(MenuStatic, 0.12f);
				Migrate(MenuStatic, 0.09f);
				Migrate(HiveMindTileSpacing, 0.37f);
				if (ReconReward.Value == 150)
				{
					ReconReward.Value = (int)((ConfigEntryBase)ReconReward).DefaultValue;
				}
				if (ReconEnemies.Value == "Interceptor")
				{
					ReconEnemies.Value = (string)((ConfigEntryBase)ReconEnemies).DefaultValue;
				}
				Migrate(AutopilotAvoidRadius, 45f);
				Migrate(AutopilotEvaParkDistance, 200f);
				Migrate(UpgradeThrusterLight, 4000f);
				Migrate(HiveMindScreenGap, 0.05f);
				Migrate(HiveMindScreenGap, 0.08f);
				Migrate(HiveMindScreenGap, 0.13f);
				Migrate(HiveMindScreenGap, 0.09f);
				Migrate(HiveMindScreenWidth, 1.1f);
				Migrate(AutopilotEvaParkHeight, 70f);
				Migrate(AutopilotEvaClearance, 45f);
				Migrate(CarrierWeaponDamage, 0.15f);
				if (CarrierMaxDrones.Value == 4)
				{
					CarrierMaxDrones.Value = (int)((ConfigEntryBase)CarrierMaxDrones).DefaultValue;
				}
				Migrate(ReconChance, 0.4f);
				Migrate(CarrierChance, 0.25f);
				Migrate(ShelfRight, 1.1f);
				Migrate(ShelfUp, 0.9f);
				Migrate(ShelfForward, 0.2f);
				Migrate(ShelfUp, 0.05f);
				Migrate(CarrierSpread, 4f);
				Migrate(ShelfRight, 1f);
				Migrate(ShelfUp, 0.2f);
				Migrate(CarrierSpread, 5f);
				Migrate(CarrierFireRate, 0.8f);
				Migrate(ShelfRight, 0.7f);
				Migrate(CarrierSpread, 8f);
				Migrate(CarrierHealth, 8000f);
				Migrate(CarrierSpread, 10f);
				Migrate(AutopilotEvaParkHeight, 20f);
				val.Value = 30;
				((BaseUnityPlugin)this).Config.Save();
			}
		}

		private static void Migrate(ConfigEntry<float> entry, float oldDefault)
		{
			if (Mathf.Abs(entry.Value - oldDefault) < 0.0001f)
			{
				float num = (float)((ConfigEntryBase)entry).DefaultValue;
				Log.LogInfo((object)$"Config {((ConfigEntryBase)entry).Definition}: {entry.Value} -> {num} (new default)");
				entry.Value = num;
			}
		}

		private static void ApplyPatches()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			Harmony val = new Harmony("VoidDrones");
			int num = 0;
			Type[] typesFromAssembly = AccessTools.GetTypesFromAssembly(typeof(Plugin).Assembly);
			foreach (Type type in typesFromAssembly)
			{
				if (type.GetCustomAttributes(typeof(HarmonyPatch), inherit: false).Length != 0)
				{
					try
					{
						val.CreateClassProcessor(type).Patch();
					}
					catch (Exception ex)
					{
						num++;
						Log.LogError((object)("Patch " + type.Name + " failed and was skipped: " + ex.GetBaseException().Message));
					}
				}
			}
			if (num > 0)
			{
				Log.LogWarning((object)$"{num} patch(es) failed; related features won't work");
			}
		}

		private void Start()
		{
			if (Events.Instance == null)
			{
				Log.LogWarning((object)"VoidManager events unavailable; drone keys will also fire while typing in chat");
				return;
			}
			Events.Instance.ChatWindowOpened += delegate
			{
				ChatOpen = true;
			};
			Events.Instance.ChatWindowClosed += delegate
			{
				ChatOpen = false;
			};
		}
	}
	internal class VoidDronesSettings : ModSettingsMenu
	{
		private static readonly string[] Tabs = new string[4] { "General", "Flight & camera", "Display", "Void Hive Mind" };

		private int tab;

		private static readonly List<ConfigEntryBase> Drawn = new List<ConfigEntryBase>();

		private static ConfigEntry<Key> rebinding;

		public override string Name()
		{
			return "Void Drones";
		}

		public override void OnClose()
		{
			rebinding = null;
			((BaseUnityPlugin)Plugin.Instance).Config.Save();
		}

		public override void Draw()
		{
			CatchRebind();
			Drawn.Clear();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int i = 0; i < Tabs.Length; i++)
			{
				if (GUILayout.Toggle(tab == i, Tabs[i], GUI.skin.button, Array.Empty<GUILayoutOption>()))
				{
					tab = i;
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			switch (tab)
			{
			case 0:
				General();
				break;
			case 1:
				Flight();
				break;
			case 2:
				Display();
				break;
			default:
				HiveMind();
				break;
			}
			GUILayout.Space(10f);
			if (!GUILayout.Button("Reset this tab to defaults (" + Tabs[tab] + ")", Array.Empty<GUILayoutOption>()))
			{
				return;
			}
			foreach (ConfigEntryBase item in Drawn)
			{
				item.BoxedValue = item.DefaultValue;
			}
			rebinding = null;
		}

		private static void CatchRebind()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Invalid comparison between Unknown and I4
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			if (rebinding == null || Keyboard.current == null)
			{
				return;
			}
			Enumerator<KeyControl> enumerator = Keyboard.current.allKeys.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					KeyControl current = enumerator.Current;
					if (current != null && ((ButtonControl)current).wasPressedThisFrame)
					{
						if ((int)current.keyCode != 60)
						{
							rebinding.Value = current.keyCode;
						}
						rebinding = null;
						break;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose();
			}
		}

		private static void KeyButton(string label, ConfigEntry<Key> entry)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			Drawn.Add((ConfigEntryBase)(object)entry);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label(label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(420f) });
			if (GUILayout.Button((rebinding == entry) ? "Press a key... (Esc cancels)" : ((object)entry.Value/*cast due to .constrained prefix*/).ToString(), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(160f) }))
			{
				rebinding = ((rebinding == entry) ? null : entry);
			}
			GUILayout.EndHorizontal();
		}

		private static void General()
		{
			Header("Unlocks");
			bool num = (GUI.enabled = !PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient);
			bool flag2 = GUILayout.Toggle(Plugin.UnlockAll.Value, " Unlock every Void Drones item from the start of a run (the host's setting, for everyone)", Array.Empty<GUILayoutOption>());
			GUI.enabled = true;
			if (num && flag2 != Plugin.UnlockAll.Value)
			{
				Messaging.Echo("Void Drones: " + DroneUnlocks.Command(flag2 ? "on" : "off"), true);
			}
			if (!num)
			{
				GUILayout.Label("Set by the host: " + (DroneUnlocks.Active ? "ON" : "OFF") + " in this session.", Array.Empty<GUILayoutOption>());
			}
			Header("Missions (the host's settings)");
			GUI.enabled = num;
			Toggle("Recon Sweep side mission", Plugin.ReconEnabled);
			Slider("Recon Sweep chance per mission sector", Plugin.ReconChance, 0f, 1f, "0%");
			Toggle("HOLLOW Carrier encounters", Plugin.CarrierEnabled);
			Slider("HOLLOW Carrier chance per mission sector", Plugin.CarrierChance, 0f, 1f, "0%");
			GUI.enabled = true;
			if (!num)
			{
				GUILayout.Label("Only the host's mission settings count in this session.", Array.Empty<GUILayoutOption>());
			}
			Header("Help");
			Toggle("Show first-use tips", Plugin.HintsEnabled);
			if (GUILayout.Button("Show the tips again", Array.Empty<GUILayoutOption>()))
			{
				ConfigEntry<bool> hintSeenController = Plugin.HintSeenController;
				ConfigEntry<bool> hintSeenFlight = Plugin.HintSeenFlight;
				bool flag3 = (Plugin.HintSeenHiveMind.Value = false);
				bool value = (hintSeenFlight.Value = flag3);
				hintSeenController.Value = value;
			}
			Header("Audio");
			Slider("Drone engine volume", Plugin.EngineVolume, 0f, 2f, "0.00");
			Toggle("Hear the battle from the drone while flying", Plugin.ListenFromDrone);
			Toggle("Voice lines (Hive Mind, controllers, autopilot on / off)", Plugin.AutopilotVoiceLines);
			Slider("Voice line volume", Plugin.AutopilotVoiceVolume, 0f, 2f, "0.00");
			Slider("Sound effects volume (menu, launch, recall, mine lock)", Plugin.EffectsVolume, 0f, 2f, "0.00");
		}

		private static void Flight()
		{
			Header("Controls");
			Slider("Mouse sensitivity", Plugin.MouseSensitivity, 0.02f, 0.3f, "0.000");
			Toggle("Invert mouse Y", Plugin.InvertMouseY);
			Header("Camera");
			Toggle("Start in first person", Plugin.FirstPersonDefault);
			Slider("First person: camera behind the muzzle (m)", Plugin.FirstPersonBack, 0f, 15f, "0.0");
			Slider("First person: fish-eye", Plugin.Fisheye, 0f, 0.4f, "0.00");
			Slider("First person: vignette", Plugin.FirstPersonVignette, 0f, 0.6f, "0.00");
			Slider("Chase camera distance (m)", Plugin.CameraDistance, 10f, 60f, "0");
			Slider("Chase camera height (m)", Plugin.CameraHeight, 0f, 20f, "0.0");
			Slider("Crosshair distance, third person (m)", Plugin.CrosshairDistance, 0f, 1500f, "0");
			Slider("HUD lag behind turns", Plugin.ReticleLag, 0f, 2f, "0.00");
			Header("Keys (click, then press the new key)");
			KeyButton("Launch / recall the drone", Plugin.LaunchKey);
			KeyButton("Forward", Plugin.KeyForward);
			KeyButton("Back", Plugin.KeyBack);
			KeyButton("Left", Plugin.KeyLeft);
			KeyButton("Right", Plugin.KeyRight);
			KeyButton("Up", Plugin.KeyUp);
			KeyButton("Down", Plugin.KeyDown);
			KeyButton("Roll left", Plugin.KeyRollLeft);
			KeyButton("Roll right", Plugin.KeyRollRight);
			KeyButton("Boost", Plugin.KeyBoost);
			KeyButton("Drop a mine", Plugin.MineDropKey);
			KeyButton("Chase / first-person camera", Plugin.CameraToggleKey);
			KeyButton("Rear view (hold)", Plugin.RearViewKey);
			KeyButton("Spot what the drone looks at", Plugin.SpotKey);
			KeyButton("Call the Void Hive Mind to your drone", Plugin.CallKey);
			KeyButton("Void jump prep / jump", Plugin.RemoteJumpKey);
		}

		private static void Display()
		{
			Header("Drone");
			Toggle("Fighter-style first-person HUD", Plugin.CockpitHud);
			Toggle("Damage sparks and smoke", Plugin.DamageEffects);
			Toggle("Launch and recall sequence (the host's setting)", Plugin.LaunchSequence);
			Header("Controller");
			Toggle("Spinning drone preview in the menu", Plugin.MenuPreview);
			Toggle("Mirror the menu on the controller's monitor", Plugin.ControllerMonitor);
			Toggle("Hide the turret HUD while no drone is out", Plugin.HideHudWithoutDrone);
			Slider("Menu screen static", Plugin.MenuStatic, 0f, 0.3f, "0.00");
		}

		private static void HiveMind()
		{
			GUILayout.Label("These matter on the host's game (it flies the ship).", Array.Empty<GUILayoutOption>());
			Toggle("Post its routine updates in chat (task, focus, boosts)", Plugin.HiveMindChat);
			Toggle("Detailed autopilot log (for testers)", Plugin.VerboseAutopilotLog);
			Header("Flying");
			Slider("Cruising speed (share of top speed)", Plugin.AutopilotSpeed, 0.2f, 1f, "0.00");
			Toggle("Use the thruster boost (catch up, dodge big attacks)", Plugin.AutopilotUseBoost);
			Toggle("Full pilot skill tree while flying (every Pilot perk maxed)", Plugin.HiveMindPilotPerks);
			Toggle("Charge the void drive and set the escape vector when the sector is done", Plugin.AutopilotPrepareJump);
			Slider("Obstacle clearance (m)", Plugin.AutopilotAvoidRadius, 20f, 150f, "0");
			Slider("Steer around enemy ships within (m)", Plugin.AutopilotAvoidEnemyRange, 0f, 300f, "0");
			Slider("Steer around mines and small objects within (m)", Plugin.AutopilotAvoidSmallRange, 0f, 400f, "0");
			Header("Tasks");
			Slider("Collect loot within (m)", Plugin.AutopilotLootRange, 0f, 3000f, "0");
			Slider("Explore unscanned objects within (m)", Plugin.AutopilotExploreRange, 0f, 5000f, "0");
			Slider("EVA parking distance (m)", Plugin.AutopilotEvaParkDistance, 30f, 300f, "0");
			Slider("EVA parking clearance from the structure (m)", Plugin.AutopilotEvaClearance, 15f, 150f, "0");
			Slider("EVA parking height above the objective (m)", Plugin.AutopilotEvaParkHeight, 0f, 200f, "0");
			IntSlider("Target locks", Plugin.AutopilotLockCount, 0, 4);
			Header("Loot");
			Slider("Void Hive Mind drop chance (vs the Auto-Mechanic)", Plugin.HiveMindDropChance, 1f, 3f, "0.0x", "takes effect for loot generated from now on");
		}

		private static void Header(string text)
		{
			GUILayout.Space(6f);
			GUILayout.Label("<b>" + text + "</b>", Array.Empty<GUILayoutOption>());
		}

		private static void Toggle(string label, ConfigEntry<bool> entry)
		{
			Drawn.Add((ConfigEntryBase)(object)entry);
			bool flag = GUILayout.Toggle(entry.Value, " " + label, Array.Empty<GUILayoutOption>());
			if (flag != entry.Value)
			{
				entry.Value = flag;
			}
		}

		private static void Slider(string label, ConfigEntry<float> entry, float min, float max, string format, string note = null)
		{
			Drawn.Add((ConfigEntryBase)(object)entry);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label(label + ": " + entry.Value.ToString(format.Replace("x", "")) + (format.EndsWith("x") ? "x" : ""), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(420f) });
			float num = GUILayout.HorizontalSlider(entry.Value, min, max, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(160f) });
			if (GUILayout.Button("Reset", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }))
			{
				num = (float)((ConfigEntryBase)entry).DefaultValue;
			}
			GUILayout.EndHorizontal();
			if (note != null)
			{
				GUILayout.Label("<size=11>" + note + "</size>", Array.Empty<GUILayoutOption>());
			}
			if (Mathf.Abs(num - entry.Value) > 1E-05f)
			{
				entry.Value = num;
			}
		}

		private static void IntSlider(string label, ConfigEntry<int> entry, int min, int max)
		{
			Drawn.Add((ConfigEntryBase)(object)entry);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label($"{label}: {entry.Value}", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(420f) });
			int num = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)entry.Value, (float)min, (float)max, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(160f) }));
			if (GUILayout.Button("Reset", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }))
			{
				num = (int)((ConfigEntryBase)entry).DefaultValue;
			}
			GUILayout.EndHorizontal();
			if (num != entry.Value)
			{
				entry.Value = num;
			}
		}
	}
	public class VoidManagerPlugin : VoidPlugin
	{
		public override MultiplayerType MPType => (MultiplayerType)30;

		public override string Author => "NeoLorem";

		public override string Description => "Fly combat drones from a gunner seat, and let the Void Hive Mind fly the ship.";
	}
}
namespace VoidDrones.Patches
{
	[HarmonyPatch(typeof(CameraWeaponFeedEffects), "NormalFireFeedback")]
	internal static class CameraFeedFirePatch
	{
		private static readonly FieldRef<CameraWeaponFeedEffects, CompositeWeaponModule> CurrentWeapon = AccessTools.FieldRefAccess<CameraWeaponFeedEffects, CompositeWeaponModule>("_currentWeaponModule");

		private static bool Prefix(CameraWeaponFeedEffects __instance)
		{
			CompositeWeaponModule val = CurrentWeapon.Invoke(__instance);
			if ((Object)(object)val != (Object)null && val.ActiveOutsideElementCollection != null)
			{
				return (Object)(object)val.ActiveOutsideElementCollection.Feeder != (Object)null;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(CruiseControlModule), "FixedUpdate")]
	internal static class CruiseAutopilotPatch
	{
		private static void Postfix(CruiseControlModule __instance)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)DroneAutopilot.Engaged == (Object)null) && !((Object)(object)__instance.Engine == (Object)null) && __instance.Engine.ThrustInputs.ContainsKey("Cruise"))
			{
				__instance.Engine.ThrustInputs["Cruise"] = Vector3.zero;
				__instance.Engine.TorqueInputs["Cruise"] = Vector3.zero;
			}
		}
	}
	[HarmonyPatch(typeof(CruiseControlModule), "OnShipCollision")]
	internal static class CruiseBumperLogPatch
	{
		private static float nextIgnoredLog;

		private static bool Prefix(CruiseControlModule __instance)
		{
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			if (!((ChangeResponsive<bool>)(object)__instance.VelocityLocked).Value)
			{
				return true;
			}
			RepulsionSystem shipRepulsion = __instance.ShipRepulsion;
			Collider val = (((Object)(object)shipRepulsion != (Object)null && shipRepulsion.Collisions != null && shipRepulsion.Collisions.Count > 0) ? shipRepulsion.Collisions[shipRepulsion.Collisions.Count - 1] : null);
			OrbitObject val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponentInParent<OrbitObject>() : null);
			string text = (((Object)(object)val == (Object)null) ? "something" : (((Object)(object)val2 != (Object)null) ? ((Object)val2).name : ((Object)((Component)val).transform.root).name).Replace("(Clone)", "").Trim());
			MovingSpacePlatform val3 = (((Object)(object)__instance.Engine != (Object)null) ? __instance.Engine.ShipMovementController : null);
			float num;
			if (!((Object)(object)val3 != (Object)null))
			{
				num = 0f;
			}
			else
			{
				Vector3 velocity = ((SpacePlatform)val3).Velocity;
				num = ((Vector3)(ref velocity)).magnitude;
			}
			float num2 = num;
			string text2 = (DroneAutopilot.AnyPoweredOn(((AbstractEnvironmentalObject)__instance).Ship) ? " (Void Hive Mind flying)" : "");
			float num3 = (((Object)(object)val != (Object)null) ? GapToHull(__instance, (Component)(object)shipRepulsion, val) : 0f);
			if (Plugin.CruiseOnlyOnContact.Value && (Object)(object)val != (Object)null && num3 > Plugin.CruiseContactDistance.Value)
			{
				if (Time.time >= nextIgnoredLog)
				{
					nextIgnoredLog = Time.time + 5f;
					Plugin.Log.LogInfo((object)$"Cruise mode kept on: the bumper brushed {text} ({((Object)val).name}) {num3:0} m from the hull at {num2:0.0} m/s{text2}");
				}
				return false;
			}
			Plugin.Log.LogInfo((object)string.Format("Cruise mode dropped: {0} ({1}) touched the hull ({2:0} m) at {3:0.0} m/s{4}", text, ((Object)(object)val != (Object)null) ? ((Object)val).name : "?", num3, num2, text2));
			return true;
		}

		private static float GapToHull(CruiseControlModule cruise, Component bumper, Collider touched)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			Transform root = ((Component)cruise).transform.root;
			Vector3 position = root.position;
			Vector3 val = Nearest(touched, position);
			float num = float.MaxValue;
			Collider[] componentsInChildren = ((Component)root).GetComponentsInChildren<Collider>();
			foreach (Collider val2 in componentsInChildren)
			{
				if (!val2.isTrigger && val2.enabled && (!((Object)(object)bumper != (Object)null) || !((Component)val2).transform.IsChildOf(bumper.transform)))
				{
					Bounds bounds = val2.