Decompiled source of LCV4PLUS v0.1.0

V4AnomalyCleanup.dll

Decompiled 3 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
using V4AnomalyCleanup.Patches;
using V4AnomalyCleanup.Patches2;
using V4AnomalyCleanup.Patches3;
using V4AnomalyCleanup.Patches4;
using V4AnomalyCleanup.Patches5;
using V4AnomalyCleanup.Patches6;
using V4AnomalyCleanup.Patches7;
using V4AnomalyCleanup.Patches8;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("V4AnomalyCleanup")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP")]
[assembly: AssemblyProduct("V4AnomalyCleanup")]
[assembly: AssemblyCopyright("Copyright © HP 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8f3137d7-9c25-48c1-ad0b-51f9d65009ce")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace V4AnomalyCleanup
{
	public class AnomalyCleanupConfig
	{
		public bool UseTestEnemyRedPillInsteadOfFlowerman { get; set; }

		public bool MoveApparatusInIntroSceneToItsCorrectLocation { get; set; }

		public bool UseTestAnomalyOnly { get; set; }

		public bool EnableVaultDoorAndDisableTestRoom { get; set; }

		public float ElevatorChargingSpeed { get; set; }
	}
	[BepInPlugin("elxd.AnomalyCleanup", "Anomaly Restoration and Cleanup", "1.0.0")]
	public class AnomalyCleanupBase : BaseUnityPlugin
	{
		private const string modGUID = "elxd.AnomalyCleanup";

		private const string modName = "Anomaly Restoration and Cleanup";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("elxd.AnomalyCleanup");

		public static AnomalyCleanupBase Instance;

		public ConfigFile config;

		internal ManualLogSource mls;

		private void Awake()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			config = new ConfigFile(Path.Combine(Paths.ConfigPath, "AnomalyCleanup.cfg"), true);
			config.Bind<bool>("General", "UseTestEnemyRedPillInsteadOfFlowerman", true, (ConfigDescription)null);
			config.Bind<bool>("General", "MoveApparatusInIntroSceneToItsCorrectLocation", true, (ConfigDescription)null);
			config.Bind<bool>("General", "UseTestAnomalyOnly", false, (ConfigDescription)null);
			config.Bind<bool>("General", "EnableVaultDoorAndDisableTestRoom", true, (ConfigDescription)null);
			config.Bind<float>("General", "ElevatorChargingSpeed", 9f, (ConfigDescription)null);
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("elxd.AnomalyCleanup");
			mls.LogInfo((object)"The mod has risen.");
			harmony.PatchAll(typeof(AnomalyCleanupBase));
			harmony.PatchAll(typeof(RoundManagerPatch));
			harmony.PatchAll(typeof(RoundManagerPatchUpdate));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
			harmony.PatchAll(typeof(RoundManagerPatchSpawnEnemy));
			harmony.PatchAll(typeof(StartOfRoundStartGame));
			harmony.PatchAll(typeof(MenuStart));
			harmony.PatchAll(typeof(RoundManagerSpawnProps));
			harmony.PatchAll(typeof(StartOfRoundLandship));
			harmony.PatchAll(typeof(OpenShipDoors));
			harmony.PatchAll(typeof(SeedPatch));
			harmony.PatchAll(typeof(GenerationPatch));
		}
	}
}
namespace V4AnomalyCleanup.Patches
{
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatch
	{
		[HarmonyPatch(typeof(RoundManager), "GeneratedFloorPostProcessing")]
		[HarmonyPostfix]
		private static void Spawnanomaly(RoundManager __instance)
		{
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: Unknown result type (might be due to invalid IL or missing references)
			//IL_0465: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: 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)
			List<int> list = new List<int>();
			int num = Random.Range(__instance.currentLevel.minAnomalies, __instance.currentLevel.maxAnomalies);
			GameObject[] array = (from obj in Object.FindObjectsOfType<GameObject>()
				where ((Object)obj).name.ToLower().Contains("anomalyspawnbox")
				select obj).ToArray();
			while (num > 0)
			{
				num--;
				int num2;
				while (true)
				{
					num2 = Random.Range(0, array.Length);
					Debug.Log((object)$"Generated box index: {num2}");
					if (num2 >= 0 && num2 < array.Length)
					{
						if (!list.Contains(num2))
						{
							break;
						}
					}
					else
					{
						Debug.LogError((object)$"there are {array} spawners loaded");
					}
				}
				GameObject val = array[num2];
				list.Add(num2);
				GameObject[] source = Resources.FindObjectsOfTypeAll<GameObject>();
				GameObject[] array2 = source.Where((GameObject go) => ((Object)go).GetInstanceID() == 9140 || ((Object)go).GetInstanceID() == 8986 || ((Object)go).GetInstanceID() == 9044).ToArray();
				AnomalyCleanupBase instance = AnomalyCleanupBase.Instance;
				int num3 = Random.Range(0, array2.Length);
				GameObject val2 = ((!instance.config.Bind<bool>("General", "UseTestAnomalyOnly", false, (ConfigDescription)null).Value) ? Object.Instantiate<GameObject>(array2[num3], val.transform.position, Quaternion.Euler(315f, 0f, 315f)) : Object.Instantiate<GameObject>(array2[0], val.transform.position, Quaternion.Euler(315f, 0f, 315f)));
				Anomaly component = val2.GetComponent<Anomaly>();
				Light val3 = ((Component)component).gameObject.AddComponent<Light>();
				val3.type = (LightType)2;
				val3.color = new Color(1f, 1f, 1f);
				if (!NetworkManager.Singleton.IsServer)
				{
					Object.Destroy((Object)(object)((Component)component).gameObject);
					return;
				}
				NetworkObject component2 = ((Component)component).gameObject.GetComponent<NetworkObject>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.Spawn(true);
				}
				component.Start();
				__instance.SpawnedAnomalies = __instance.SpawnedAnomalies ?? new List<Anomaly>();
				__instance.SpawnedAnomalies.Add(component);
			}
			GameObject[] source2 = Resources.FindObjectsOfTypeAll<GameObject>();
			GameObject val4 = ((IEnumerable<GameObject>)source2).FirstOrDefault((Func<GameObject, bool>)((GameObject go) => ((Object)go).GetInstanceID() == 15086));
			GameObject val5 = ((IEnumerable<GameObject>)source2).FirstOrDefault((Func<GameObject, bool>)((GameObject go) => ((Object)go).GetInstanceID() == 13146));
			SyncWithServerOnSpawn val6 = val4.AddComponent<SyncWithServerOnSpawn>();
			SyncWithServerOnSpawn val7 = val5.AddComponent<SyncWithServerOnSpawn>();
			GameObject[] array3 = (from obj in Object.FindObjectsOfType<GameObject>()
				where ((Object)obj).name.ToLower().Contains("singlebatteryspawn") && obj.activeInHierarchy
				select obj).ToArray();
			int num4 = array3.Length;
			Debug.Log((object)$"there are {num4} single battery spawners");
			for (int i = 0; i < array3.Length; i++)
			{
				num4--;
				Debug.Log((object)"single battery iterate");
				GameObject val8 = Object.Instantiate<GameObject>(val4, array3[num4].transform.position, Quaternion.Euler(0f, 0f, 0f));
				array3[num4].SetActive(false);
				if (!NetworkManager.Singleton.IsServer)
				{
					Debug.Log((object)"Remove Battery single");
					Object.Destroy((Object)(object)val8.gameObject);
					return;
				}
				NetworkObject component3 = val8.gameObject.GetComponent<NetworkObject>();
				if ((Object)(object)component3 != (Object)null)
				{
					Debug.Log((object)"Spawn Single battery");
					component3.Spawn(true);
				}
				__instance.spawnedSyncedObjects.Add(val8);
			}
			GameObject[] array4 = (from obj in Object.FindObjectsOfType<GameObject>()
				where ((Object)obj).name.ToLower().Contains("batterypackspawn") && obj.activeInHierarchy
				select obj).ToArray();
			num4 = array4.Length;
			Debug.Log((object)$"there are {num4} doubele battery spawners");
			for (int j = 0; j < array4.Length; j++)
			{
				num4--;
				GameObject val8 = Object.Instantiate<GameObject>(val5, array4[num4].transform.position, Quaternion.Euler(0f, 0f, 0f));
				array4[num4].SetActive(false);
				if (!NetworkManager.Singleton.IsServer)
				{
					Debug.Log((object)"Remove Battery dual");
					Object.Destroy((Object)(object)val8.gameObject);
					break;
				}
				NetworkObject component4 = val8.gameObject.GetComponent<NetworkObject>();
				if ((Object)(object)component4 != (Object)null)
				{
					Debug.Log((object)"Spawn double battery");
					component4.Spawn(true);
				}
				__instance.spawnedSyncedObjects.Add(val8);
			}
		}
	}
	internal class GenerationPatch
	{
		[HarmonyPatch(typeof(RoundManager), "GenerateNewFloor")]
		[HarmonyPrefix]
		private static bool Generatefloor(RoundManager __instance)
		{
			__instance.levelNumber++;
			if (!__instance.hasInitializedLevelRandomSeed)
			{
				__instance.hasInitializedLevelRandomSeed = true;
				__instance.AnomalyRandom = new Random(__instance.playersManager.randomMapSeed + 5);
				__instance.AnomalyValuesRandom = new Random(__instance.playersManager.randomMapSeed - 40);
			}
			__instance.dungeonGenerator.Generator.ShouldRandomizeSeed = false;
			__instance.dungeonGenerator.Generator.Seed = __instance.playersManager.randomMapSeed + __instance.levelNumber;
			__instance.dungeonGenerator.Generator.LengthMultiplier = __instance.currentLevel.levelSizeMultiplier;
			__instance.dungeonGenerator.Generate();
			Debug.Log((object)$"Seed: {__instance.dungeonGenerator.Generator.Seed}");
			Debug.Log((object)$"Size: {__instance.currentLevel.levelSizeMultiplier}");
			Debug.Log((object)$"Floor: {__instance.levelNumber}");
			return false;
		}

		[HarmonyPatch(typeof(LevelGenerationManager))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static bool ungeneratefloor(RoundManager __instance)
		{
			return false;
		}

		[HarmonyPatch(typeof(RoundManager))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static bool FloorpostGen(RoundManager __instance)
		{
			__instance.RefreshLightsList();
			__instance.TurnBreakerSwitchesOff();
			__instance.gameAnomaliesTimer = 0f;
			__instance.currentLevel.minAnomalies = Mathf.Clamp(__instance.levelNumber + 1, 0, 6);
			__instance.currentLevel.maxAnomalies = Mathf.Clamp(__instance.levelNumber + 3, __instance.currentLevel.minAnomalies + 1, 255);
			__instance.currentLevel.levelSizeMultiplier = Mathf.Clamp(__instance.currentLevel.levelSizeMultiplier + 0.1f, 0.7f, 2.25f);
			return false;
		}

		[HarmonyPatch(typeof(RoundManager))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static void RunningElevator(RoundManager __instance)
		{
			HUDManager val = Object.FindObjectOfType<HUDManager>();
			__instance.SpawnedAnomalies.ToList().ForEach(delegate(Anomaly anomaly)
			{
				Object.Destroy((Object)(object)anomaly);
			});
			__instance.instabilityLevel = 0f;
			val.UpdateInstabilityPercentage((int)__instance.instabilityLevel);
		}
	}
}
namespace V4AnomalyCleanup.Patches5
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundStartGame
	{
		[HarmonyPatch(typeof(StartOfRound))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		private static void StartRound(StartOfRound __instance)
		{
			AnomalyCleanupBase instance = AnomalyCleanupBase.Instance;
			RoundManager val = Object.FindObjectOfType<RoundManager>();
			val.elevatorChargeSpeed = instance.config.Bind<float>("General", "ElevatorChargingSpeed", 9f, (ConfigDescription)null).Value;
			GameObject[] source = Resources.FindObjectsOfTypeAll<GameObject>();
			GameObject val2 = ((IEnumerable<GameObject>)source).FirstOrDefault((Func<GameObject, bool>)((GameObject go) => ((Object)go).name == "BatteryNum"));
			if ((Object)(object)val2 != (Object)null)
			{
				((TMP_Text)val2.GetComponent<TextMeshProUGUI>()).text = "0";
			}
			if (!instance.config.Bind<bool>("General", "EnableVaultDoorAndDisableTestRoom", true, (ConfigDescription)null).Value)
			{
				return;
			}
			GameObject val3 = ((IEnumerable<GameObject>)source).FirstOrDefault((Func<GameObject, bool>)((GameObject go) => ((Object)go).name == "VaultDoor"));
			if ((Object)(object)val3 != (Object)null)
			{
				val3.SetActive(true);
			}
			GameObject[] array = source.Where((GameObject go) => ((Object)go).name == "TestRoom").ToArray();
			if (array.Length != 0)
			{
				GameObject[] array2 = array;
				foreach (GameObject val4 in array2)
				{
					val4.SetActive(false);
				}
			}
		}
	}
}
namespace V4AnomalyCleanup.Patches7
{
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerSpawnProps
	{
		[HarmonyPatch(typeof(RoundManager))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static bool SpawnProps(RoundManager __instance)
		{
			//IL_0043: 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)
			__instance.spawnedSyncedObjects.Clear();
			SpawnSyncedObject[] array = Object.FindObjectsOfType<SpawnSyncedObject>();
			Debug.Log((object)$"Spawning synced props on server. Length: {array.Length}");
			for (int i = 0; i < array.Length; i++)
			{
				GameObject val = Object.Instantiate<GameObject>(array[i].spawnPrefab, ((Component)array[i]).transform.position, ((Component)array[i]).transform.rotation, __instance.syncedPropsContainer);
				if (!((Object)val).name.ToLower().Contains("battery"))
				{
					if (!NetworkManager.Singleton.IsServer)
					{
						Object.Destroy((Object)(object)val);
						return false;
					}
					NetworkObject component = val.GetComponent<NetworkObject>();
					if ((Object)(object)component != (Object)null)
					{
						component.Spawn(true);
						__instance.spawnedSyncedObjects.Add(val);
					}
				}
				else
				{
					Object.Destroy((Object)(object)val);
				}
			}
			return false;
		}
	}
}
namespace V4AnomalyCleanup.Patches4
{
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatchSpawnEnemy
	{
		[HarmonyPatch(typeof(RoundManager))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static bool SpawnEnemyPatch(RoundManager __instance, Vector3 spawnPosition, int enemyNumber)
		{
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			AnomalyCleanupBase instance = AnomalyCleanupBase.Instance;
			if (__instance.SpawnedEnemies.Count < __instance.levelNumber + __instance.SpawnedAnomalies.Count)
			{
				GameObject[] source = Resources.FindObjectsOfTypeAll<GameObject>();
				GameObject val = ((IEnumerable<GameObject>)source).FirstOrDefault((Func<GameObject, bool>)((GameObject go) => ((Object)go).GetInstanceID() == 9058));
				int num = enemyNumber;
				if (enemyNumber == -1)
				{
					num = Random.Range(0, __instance.EnemyTypes.Length);
				}
				GameObject val2 = ((!instance.config.Bind<bool>("General", "UseTestEnemyRedPillInsteadOfFlowerman", true, (ConfigDescription)null).Value) ? Object.Instantiate<GameObject>(__instance.EnemyTypes[num].enemyPrefab, spawnPosition, Quaternion.identity) : Object.Instantiate<GameObject>(val, spawnPosition, Quaternion.identity));
				val2.GetComponentInChildren<NetworkObject>().Spawn(true);
				__instance.SpawnedEnemies.Add(val2.GetComponent<EnemyAI>());
			}
			return false;
		}
	}
}
namespace V4AnomalyCleanup.Patches2
{
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatchUpdate
	{
		[HarmonyPatch(typeof(RoundManager))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		private static void UpdatePatch(RoundManager __instance)
		{
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			HUDManager val = Object.FindObjectOfType<HUDManager>();
			GameObject[] array = (from obj in Object.FindObjectsOfType<GameObject>()
				where ((Object)obj).name.ToLower().Contains("vententrance")
				select obj).ToArray();
			if ((Object)(object)val != (Object)null)
			{
				val.UpdateInstabilityPercentage((int)__instance.instabilityLevel);
			}
			if ((double)__instance.instabilityLevel > 100.5)
			{
				__instance.instabilityLevel -= 31f;
				int num = Random.Range(0, array.Length);
				GameObject val2 = array[num];
				__instance.SpawnEnemyOnServer(val2.transform.position, 0);
			}
		}
	}
}
namespace V4AnomalyCleanup.Patches3
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch(typeof(PlayerControllerB))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static bool ReloadbatteriesPatch(PlayerControllerB __instance, CallbackContext context)
		{
			if ((!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || (!NetworkManager.Singleton.IsServer && !__instance.isHostPlayerObject)) && !__instance.isTestingPlayer)
			{
				return false;
			}
			if (!((CallbackContext)(ref context)).performed)
			{
				return false;
			}
			if (__instance.isGrabbingObjectAnimation || __instance.inSpecialInteractAnimation || __instance.isTypingChat)
			{
				return false;
			}
			if (__instance.BatteryInventory.Count > 0 && (Object)(object)__instance.currentlyHeldObjectServer != (Object)null && __instance.currentlyHeldObjectServer.itemProperties.requiresBattery)
			{
				__instance.currentlyHeldObjectServer.insertedBattery.empty = false;
				__instance.currentlyHeldObjectServer.insertedBattery.charge = __instance.BatteryInventory[0].charge;
				__instance.BatteryInventory.RemoveAt(0);
				((TMP_Text)HUDManager.Instance.batteryInventoryNumber).text = __instance.BatteryInventory.Count.ToString();
			}
			return false;
		}

		[HarmonyPatch(typeof(PlayerControllerB))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static void materialpatch(PlayerControllerB __instance)
		{
		}

		[HarmonyPatch(typeof(PlayerControllerB))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static void deathpatch(PlayerControllerB __instance)
		{
		}
	}
}
namespace V4AnomalyCleanup.Patches6
{
	[HarmonyPatch(typeof(MenuManager))]
	internal class MenuStart
	{
		[HarmonyPatch(typeof(MenuManager))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		private static void StartGame(MenuManager __instance)
		{
			GameObject[] source = Object.FindObjectsOfType<GameObject>();
			GameObject val = ((IEnumerable<GameObject>)source).FirstOrDefault((Func<GameObject, bool>)((GameObject go) => ((Object)go).name == "VersionNum"));
			val.SetActive(true);
			TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>();
			if ((Object)(object)component != (Object)null)
			{
				((TMP_Text)component).text = "v4 PLUS";
			}
		}
	}
}
namespace V4AnomalyCleanup.Patches8
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundLandship
	{
		[HarmonyPatch(typeof(StartOfRound))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		private static void LandShip(StartOfRound __instance)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			AnomalyCleanupBase instance = AnomalyCleanupBase.Instance;
			if (!instance.config.Bind<bool>("General", "MoveApparatusInIntroSceneToItsCorrectLocation", true, (ConfigDescription)null).Value)
			{
				return;
			}
			Scene sceneByName = SceneManager.GetSceneByName("IntroScene");
			if (((Scene)(ref sceneByName)).isLoaded)
			{
				GameObject[] source = Object.FindObjectsOfType<GameObject>();
				GameObject val = ((IEnumerable<GameObject>)source).FirstOrDefault((Func<GameObject, bool>)((GameObject go) => ((Object)go).name == "LungApparatice (2)"));
				Debug.Log((object)$"there is a {val}");
				if ((Object)(object)val != (Object)null)
				{
					val.transform.localPosition = new Vector3(-194.3575f, 19.85416f, -18.173f);
				}
			}
		}
	}
	internal class OpenShipDoors
	{
		[CompilerGenerated]
		private sealed class <OpenDoorsCoroutine>d__1 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public StartOfRound __instance;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <OpenDoorsCoroutine>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Expected O, but got Unknown
				//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					((Component)__instance.shipAnimatorObject).gameObject.GetComponent<Animator>().SetTrigger("OpenShip");
					<>2__current = (object)new WaitForSeconds(2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					__instance.shipDoorAudioSource.PlayOneShot(__instance.openingHangarDoorAudio, 1f);
					HUDManager.Instance.ReadDialogue(__instance.openingDoorDialogue);
					<>2__current = (object)new WaitForSeconds(6.25f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[HarmonyPatch(typeof(StartOfRound))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static bool OpenDoors(StartOfRound __instance)
		{
			AnomalyCleanupBase instance = AnomalyCleanupBase.Instance;
			if (instance.config.Bind<bool>("General", "EnableVaultDoorAndDisableTestRoom", true, (ConfigDescription)null).Value)
			{
				((MonoBehaviour)__instance).StartCoroutine(OpenDoorsCoroutine(__instance));
				return false;
			}
			return true;
		}

		[IteratorStateMachine(typeof(<OpenDoorsCoroutine>d__1))]
		private static IEnumerator OpenDoorsCoroutine(StartOfRound __instance)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <OpenDoorsCoroutine>d__1(0)
			{
				__instance = __instance
			};
		}
	}
	internal class SeedPatch
	{
		[HarmonyPatch(typeof(StartOfRound))]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		private static void startthegame(StartOfRound __instance)
		{
			RoundManager val = Object.FindObjectOfType<RoundManager>();
		}
	}
}